Jump to content

MYSQL ORDERBY DATE UK HELP!!!


simpjd

Recommended Posts

In my sql database I have a list of dates stored as DD/MM/YY, I need a select statement that will order by date but this dosent work:

 

"SELECT * FROM table ORDER BY date DESC"

 

It orders them like this:

 

01/02/09

02/01/09

03/06/08

 

Please Help!

Link to comment
Share on other sites

That date format is not directly sortable because the yyyy mm dd fields are not arranged most significant (year) to least significant (day), which is why the DATE data type exists with a format of yyyy-mm-dd. You should be using a DATE data type to hold dates in a database.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.