I want to get records from the MySQL database with date today or later. The data is recorded into the database as VARCHAR (fieldname datum), so I need to use STR_TO_DATE. However, this query is not working:
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(), doesn't work either.
The query is working without the WHERE part. Any ideas how to fix the query?