From the following link you could use any method like
Code:
SEC_TO_TIME(),STR_TO_DATE(),CURRENT_TIMESTAMP(), CURRENT_TIMESTAMP
The Functions that expect date values usually accept datetime values and ignore the time part. Functions that expect time values usually accept datetime values and ignore the date part.
Code:
mysql> SELECT something FROM tbl_name
-> WHERE DATE_SUB(CURDATE(),INTERVAL 30 DAY) <= date_col;
Or you may use the above Functions that return the current date or time each are evaluated only once per query at the start of query execution. This means that multiple references to a function such as NOW() within a single query always produce the same result.
Bookmarks