blue-genie Posted May 26, 2010 Share Posted May 26, 2010 117 test 2010-05-12 2010-05-18 0 5 1 2010-05-17 10:56:30 9 118 uni 2010-05-19 2010-05-26 0 5 1 2010-05-17 11:14:07 9 119 test1 2010-05-27 2010-05-28 0 3 1 2010-05-18 11:19:50 9 assume the data above in a table. items 118 is the only one who's start date /end date is within the current date (ie 2010-05-26) so i need some help with that . SELECT gameID from gamedetails where date('2010-05-26') >= startDate AND date('2010-05-26')<= endDate AND gameIsActive = 1 seems to work but I just want to be sure. Link to comment https://forums.phpfreaks.com/topic/202951-date-comparison/ Share on other sites More sharing options...
Alex Posted May 26, 2010 Share Posted May 26, 2010 edit: nevermind, I posted before you edited and actually put your question. try: SELECT gameID from gamedetails where startDate >= date('2010-5-26') AND endDate < AND date('2010-5-26') AND gameIsActive = 1 is not right. Link to comment https://forums.phpfreaks.com/topic/202951-date-comparison/#findComment-1063525 Share on other sites More sharing options...
ignace Posted May 26, 2010 Share Posted May 26, 2010 SELECT gameID FROM gamedetails WHERE '2010-5-26' BETWEEN startDate AND endDate AND gameIsActive = 1 Link to comment https://forums.phpfreaks.com/topic/202951-date-comparison/#findComment-1063542 Share on other sites More sharing options...
blue-genie Posted May 26, 2010 Author Share Posted May 26, 2010 ah the magic word is between - thanks. Link to comment https://forums.phpfreaks.com/topic/202951-date-comparison/#findComment-1063547 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.