Reputation: 4007
I need to perform a mysql select query where date time field in table is less then todays date with a time of 2am.
How would I structure this
SELECT * FROM tbl WHERE datetimefield < (DATE(NOW()) and time 2am)
Thank you for any assistance.
Upvotes: 1
Views: 68
Reputation: 686
SELECT * FROM tbl WHERE datetimefield < STR_TO_DATE(concat(curdate(), ' ', '02'),'%Y-%m-%d %H')
Upvotes: 0