The DB I inherited stored there dates like: yyy-mm-dd hh:mm:ss
I was hoping to sort by date in my mysql query but it is treating them like a string and sorting accordingly.
Any one know of a way to sort them as a date and not a string in the query itself?
Thanks, Rob开发者_开发百科ert
You can try casting the value to a date and sorting by that:
ORDER BY CAST(SDate As DATETIME);
精彩评论