Question

I just want to create query statement where date format (%d-%m-%Y)

like this:

 SELECT * FROM TRANSACTION
 WHERE DATE(date_Transaction) = DATE_FORMAT('19-04-1994', '%d-%m-%Y');

but the result is

Empty set, 2 warnings (0.00 sec)

Was it helpful?

Solution

Use STR_TO_DATE()

SELECT * FROM `TRANSACTION`
WHERE DATE(date_Transaction) = STR_TO_DATE('19-04-1994', '%d-%m-%Y');
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top