Querying mysql based on date

82 views Asked by At

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.

3

There are 3 answers

0
Vince Pergolizzi On BEST ANSWER

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

0
John Woo On

try this:

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

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