I have a field in my database as text, which contain a D-M date value. The year is a new field. So ORDER BY year ASC is not that difficult. Now I wanted to also ORDER BY date.
Only problem is, ORDER BY year ASC, ORDER BY date does not work. I think because of the text field. Is it still possible to sort them on year, month, day ASC?
Thanks!
Use SUBSTRING_INDEX():
SUBSTRING(date, '-', -1)will give you everything after the-(the month).SUBSTRING(date, '-', 1)will give you everything before the-(the day).