Jump to content

Ordering by date


OhTheNoes

Recommended Posts

Hi all,

 

I've got a couple of these event entries with dates attached to them in the format of day-month-year (example: 31-01-2001) and I've got a script to display the name+date in a list. How could I go about making it so that it orders by the oldest on top like:

 

Event A

October 5, 2011 - October 8, 2011

 

Event B

October 6, 2011 - October 7, 2011

 

Event C

October 9, 2011 - December 1, 2011

 

 

Any help would be appreciated :)

Link to comment
Share on other sites

Assuming you have it stored in a database and have a start and end field, this query should work. Works for varchar, text and datetime fields types

 

SELECT * FROM `Table` ORDER BY Start ASC

 

It would help to see some code though

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.