Maybe anyone can help me with this query. I just want to select all rows between two dates, but I'm having problems with the date-format.
My query:
SELECT id, number, date
FROM `table`
WHERE (STR_TO_DATE(date, '%j-%n-%Y') between '6-4-2015' AND '6-4-2016')
I don't know what's wrong with this query. I've tried to use STR_TO_DATE
and DATE
.
The datetype of date is text (and i want like to keep it)
Here's an example of the database:
1 233 5-4-2015
2 238 6-4-2015
3 431 7-4-2015
4 230 8-4-2015
Can anybody help me?