I want to get records from a MySQL database with a date today or later. Data is written to the database as VARCHAR (fieldname datum), so I need to use STR_TO_DATE. However, this request does not work:
SELECT * FROM Diensten WHERE STR_TO_DATE('datum', '%m-%d-%Y') >= DATE(NOW()) ORDER BY STR_TO_DATE('datum', '%m-%d-%Y') ASC
I also tried CURDATE (), it doesn't work either.
The query works without the WHERE part. Any ideas on fixing the request?
source share