[MySQL] Order by custom Date
Hello. I'm actually tryinng to order all by DATE on MySQL but seems not to be possible.
The date order is like this for example: Wednesday, June 29, 2011, 18:31
I tried with this, but doesn't work:
SELECT * FROM members ORDER BY date ASC
Sometimes it works with DESC.
And also with this, and same!
SELECT * STR_TO_DATE( date, '%D, %M %d, %Y, %H:%M' ) AS date_for_sort FROM `members` ORDER BY date_for_sort;
I have this problem and I need to fix it asap for the business.
Thank you for helping,
keep the good work!
|