frazman
frazman

Reputation: 33223

Querying mysql based on date

I want to query on sql (mysql) based on the date.

Something like:

Select * from table_name where e_date > 2001-12-30;

What is the right query?

I am not able to pen down my problem and get the right response from google.

Upvotes: 0

Views: 77

Answers (3)

BizApps
BizApps

Reputation: 6130

Just add closing quotes on your date.

Select * from table_name where e_date > '2001-12-30'

Check the link below:

Date and Time Functions in MYsQL

This Site will help you out regarding date time functions

Regards

Upvotes: 2

John Woo
John Woo

Reputation: 263703

try this:

Select * 
from table_name 
where e_date > DATE('2001-12-30');

Upvotes: 1

Vince Pergolizzi
Vince Pergolizzi

Reputation: 6584

That's correct, you'll need to put the date around single quotes though.

Upvotes: 3

Related Questions