ego0 Posted August 15, 2006 Share Posted August 15, 2006 Is there a way of selecting all rows in a table after a certain date.The date format is 2006-07-22 11:41:17 and I want to select all rows since that date.So all rows since 2006-07-21 11:41:17Thanks Link to comment https://forums.phpfreaks.com/topic/17628-select-after-date/ Share on other sites More sharing options...
obsidian Posted August 15, 2006 Share Posted August 15, 2006 if your data type is DATETIME (which it appears to be), you can simply use the greater than operator:[code]SELECT * FROM table WHERE dateCol > '2006-07-22 11:41:17';[/code] Link to comment https://forums.phpfreaks.com/topic/17628-select-after-date/#findComment-75127 Share on other sites More sharing options...
fenway Posted August 15, 2006 Share Posted August 15, 2006 I think MySQL is rather lenient, and will "choose" the correct type, even if it was DATE column. Link to comment https://forums.phpfreaks.com/topic/17628-select-after-date/#findComment-75194 Share on other sites More sharing options...
ego0 Posted August 15, 2006 Author Share Posted August 15, 2006 Thanks so much :), You wouldn't beleive how helpful this is! Link to comment https://forums.phpfreaks.com/topic/17628-select-after-date/#findComment-75318 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.