Hi I've got a datetime field in a database with a format of:
2001-07-09 09:28:28
how do i query it to search for a results in the last 24 hours and then a seperate query for results in the last 7 days?
r u using postgres or mysql?
mysql
the 7 days back part could be done like this:
select * from table1 where you_datetime_field > DATE_SUB(CURDATE(), INTERVAL 7 DAY);
ps - i'm not skilled in mysql , just found this in the manual, so it may or may not work. stef