I have a row in a table which holds the time of day in am/pm format e.g.
timeField
---------
9.00am
10.00pm
7.00am
etc...
Is there a way in mysql to order these values?
I have a row in a table which holds the time of day in am/pm format e.g.
timeField
---------
9.00am
10.00pm
7.00am
etc...
Is there a way in mysql to order these values?
You can do this by using STR_TO_DATE function in MySQL:
try this:
Example: SQLFiddle
In order to order it you need to format the date field fist.
try this
Enjoy
This put everything in order for me: Alphabetized, Dates and Time