how i add days in mysql date ?

Posted: July 18, 2013 in Database
Tags: , , , ,

Here is an example that uses date functions. The following query selects all rows with a date_col value from within the last 30 days:

SELECT something FROM tbl_name WHERE DATE_SUB(CURDATE(),INTERVAL 30 DAY) <= date_col;

The query also selects rows with dates that lie in the future.

And try also that

SELECT   * FROM tbl_name   WHERE  date_col  > ‘2013/07/03’ order by date_col   limit 100

 

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s