Canman2005 Posted January 12, 2009 Share Posted January 12, 2009 Hi all I have the following QUERY SELECT * FROM orders WHERE datetime > '".$_GET['start']." 00:00:01' How can I get it to search within 1 week starting from the date define already in the QUERY. Is that at all possible? Thanks in advance Dave Link to comment https://forums.phpfreaks.com/topic/140452-query-date-plus-1-week/ Share on other sites More sharing options...
chronister Posted January 12, 2009 Share Posted January 12, 2009 Create vars to hold the query date, and another to hold the 1week date... then you can use the between operator... " SELECT * FROM orders WHERE datetime BETWEEN '$date1' and '$date2' " Thats how I would do it. Nate Link to comment https://forums.phpfreaks.com/topic/140452-query-date-plus-1-week/#findComment-735063 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.