dennismonsewicz Posted December 23, 2009 Share Posted December 23, 2009 SELECT * FROM tbl_name WHERE DATE_SUB(CURDATE(), INTERVAL -1 DAY) <= date the above sql statement is supposed to select all of the results from the past 24 hours, but when I pull the query I get nothing... any ideas? Link to comment https://forums.phpfreaks.com/topic/186198-sql-select-problems/ Share on other sites More sharing options...
dennismonsewicz Posted December 24, 2009 Author Share Posted December 24, 2009 ok so I got this working... SELECT * FROM tbl_name WHERE DATE_SUB(NOW(), INTERVAL 24 HOUR) <= date_col but it only selects the entries from today... I need it to pull entries from the past 24 hours... I pull a report every morning around 10am and need to be able to pull results from then and the past twenty four hours Link to comment https://forums.phpfreaks.com/topic/186198-sql-select-problems/#findComment-983407 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.