There are so many ways to do this. The above works fine, but here is another way if you have a datetime field:
SELECT [fields] FROM [table] WHERE timediff(now(), my_datetime_field) < '24:00:00'
timediff() returns a time object, so don't make a mistake comparing it to 86400 (number of seconds per day), or your result will be all kinds of.
Craig Labenz Jun 28 '12 at 13:40 2012-06-28 13:40
source share