Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sort date problem 1

Status
Not open for further replies.

bataraguru

Programmer
Jun 4, 2002
37
0
0
MY
Hi,
I have a query to display latest 5 updated files.
My output is like this:
Updated Date Page Title
01/01/2004 Page2
04/06/2004 Introduction
10/06/2004 Introduction
11/02/2004 Page3
28/03/2004 Page4

the problem is, I want to sort like this (latest date on top):
Updated Date Page Title
10/06/2004 Introduction
04/06/2004 Introduction
01/06/2004 Page2
28/03/2004 Page4
11/02/2004 Page3

How can I do this? I've use the dd/mm/yyyy format.
Please help...

thanks...
 
You really ought to post some code.. but its very simple

Code:
  <cfquery...>
    select * from [i]MyDataTable[/i]
    [b]order by [i]DataDateName[/i] desc[/b]
  </cfquery>

Change the items in italics to their proper names for your table and note the bold order by line, that's where the magic is.

ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
 
hi webmigit,
Thanks for your help..
Forgot about the ASC and the DESC..

Thanks again..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top