MySQL date format with correct sort

As a reminder (as much to myself as anyone in blogland) when using MySQL the formatting options for dates turn them in to strings and sort alphabetically instead of as a date. To correct this use the actual date field in the sort not the name assigned to the formatted field.

Category: