set @d ='Saturday, May 1, 2017'; select case when str_to_date(@d,'%W, %M %d, %Y') < '2017-07-23' then true else false end testit; +--------+ | testit | +--------+ | 1 | +--------+ 1 row in set (0.001 sec)
Assuming the month is not abbreviated and all date_times are in the same format ,2 facts that should be included in your question. https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_date-format
2.1m questions
2.1m answers
60 comments
56.8k users