johnsmith153 — 2010-11-18T07:46:43-05:00 — #1
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.
r937 — 2010-11-18T09:04:37-05:00 — #2
ORDER BY STR_TO_DATE(thedate,'%d/%m/%Y')
ibazz — 2010-11-18T22:04:38-05:00 — #3
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 ).
r937 — 2010-11-18T22:07:28-05:00 — #4