Reputation: 13
I have two varchar fields which store the date and time in the following format: date=2010-08-18; time=07:53:55;
What would be the right sql query to show me the events from the most recent to the oldest
Upvotes: 1
Views: 141
Reputation: 212412
Aside from recommending that you use MySQL datetime fields rather than VARCHARs for any date or time values; what about something simple like adding an ORDER BY clause to your query:
ORDER BY `DATE` DESC, `TIME` DESC
Upvotes: 3