I've got an issue selecting a date range with MySQL.
SELECT MvtDate,date_format(MvtDate,'%d-%m-%Y')
FROM (`immmvt`)
WHERE date_format(MvtDate,'%d-%m-%Y') BETWEEN '01-01-2010' AND '02-01-2010'
mvtDate
type is date like 2010-01-01 00:00:00
.
When I run the query, the result works for the days and the months but it also show me other result from other years.
Like 01-01-2011
etc.
You should use
STR_TO_DATE
since you want to convertstring
back todate