I have a table with a column having date & time. I have to get all the rows which have the date and time before the current time. So i have written the following
SELECT * FROM G_CARD_SCHEDULE WHERE TIME_TO_BE_SENT < CURRENT_TIME()
And the table has the following column
TIME_TO_BE_SENT = 2010-10-08 00:57:50
But still 0 rows are returned by the SQL, what is wrong?
CURRENT_TIME() returns only the time, not the date and time.
Try with
NOW(). See the manual section Date and Time Functions for more details.