mrobinson83 Posted March 19, 2008 Share Posted March 19, 2008 Hi there, I'm a newbie to MYSQL and PHP so please go easy! I am having trouble executing the following query... SELECT * FROM Status_Lead WHERE `Start_Time` < DATE_ADD(NOW(), INTERVAL 60 MINUTE); I am trying to select all records that have a timestamp of greater than one hour. Currently the query seems to select everything in that table. Your help would be most appreciated! Quote Link to comment Share on other sites More sharing options...
fenway Posted March 19, 2008 Share Posted March 19, 2008 Is start time a true TIMESTAMP column? Do you mean an hour ago or an hour from now? Quote Link to comment Share on other sites More sharing options...
mrobinson83 Posted March 19, 2008 Author Share Posted March 19, 2008 Start_Time is currently a TIMESTAMP column, I think I have sorted the query with the following: SELECT * FROM status_lead WHERE start_time <= DATE_SUB(NOW(),INTERVAL 1 hour) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.