hassank1 Posted January 12, 2009 Share Posted January 12, 2009 I've a datetime field in mysql (format ex: 2009-01-11 14:32:00 ) so what is the query to select all rows in the table where the date time in the field is less than or equal the current date Note : I also want the time to be compared not only the date Quote Link to comment https://forums.phpfreaks.com/topic/140495-select-where-date/ Share on other sites More sharing options...
Mchl Posted January 12, 2009 Share Posted January 12, 2009 SELECT * FROM table WHERE dateTimeField <= NOW() Quote Link to comment https://forums.phpfreaks.com/topic/140495-select-where-date/#findComment-735198 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.