A MySql database I am working with stores dates like 11/18/2010 (varchar type).
Can I arrange this in order?
Would be great if they were timestamp, but they’re not.
A MySql database I am working with stores dates like 11/18/2010 (varchar type).
Can I arrange this in order?
Would be great if they were timestamp, but they’re not.
ORDER BY STR_TO_DATE(thedate,‘%d/%m/%Y’)
or, I think, make another column called date_name (or however is appropriate, without using the reserved word ‘date’), and store them as a date or datetime column. then in your server-side language convert the date to ISO format , yyy/mm/dd and store it that way.
Once it’s done for all your exisiting records, you could remove the current column. Doing it this way (iso) can make date comparisons more efficieint, I think.
(subject to confirmation from someone more knowledgable ).
you betcha