chrischen Posted February 19, 2008 Share Posted February 19, 2008 I have a mysql date column that has date stored as mm/dd/yyyy. Is there a way I can have mysql sort this format in a query by date? Quote Link to comment Share on other sites More sharing options...
aschk Posted February 19, 2008 Share Posted February 19, 2008 Are you sure your column datatype is DATE? Because that mm/dd/yyyy is NOT the default format for MySQL. If it IS a DATE datatype column AND you've changed the default format of dates in your MySQL, then just do ORDER BY `<date column name here>` Quote Link to comment Share on other sites More sharing options...
chrischen Posted February 19, 2008 Author Share Posted February 19, 2008 Well the data is provided to me in that format and I was wondering if I can just sort that without having to convert them all. Quote Link to comment Share on other sites More sharing options...
fenway Posted February 19, 2008 Share Posted February 19, 2008 Oh, you should defintely convert them all... STR_TO_DATE() makes it easy. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.