navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

ORDER BY statement - need help!

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> ORDER BY statement - need help!
Page: [1]
 
z0diac

 

Posts: 2
Joined: 6/5/2002
From:
Status: offline

 
ORDER BY statement - need help! - 6/5/2002 0:04:59   
I have 3 fields - YEAR (4 digit value from 1998 to 2002), MONTH (1 or 2 digit value from 1 to 12, DAY (1 or 2 digit value from 1 to 31).

I need to display database records from NEWEST to OLDEST. So all must be sorted by YEAR, and the years must be sorted by MONTH, and the months must be sorted by DAY. DESCending order. Can anyone tell me what the correct SQL statement would be?
Light

 

Posts: 199
Joined: 3/28/2002
From: Earth
Status: offline

 
RE: ORDER BY statement - need help! - 6/5/2002 2:12:56   
If you're using Database Result Wizard from step 3 of 5,click on MORE OPTIONS then ORDERING, then choose from AVAILABLE FIELDS then SORT ORDER.

<%Thgil%>

(in reply to z0diac)
bobby

 

Posts: 11394
Joined: 8/15/1969
From: Seattle WA USA
Status: offline

 
RE: ORDER BY statement - need help! - 6/5/2002 10:12:17   
Have you thought of building a query into the database that does the sorting, and then call the stored procedure and sisplay the first record?
_____

"There is too much apathy in the world, but I don't care."

(in reply to z0diac)
Malc

 

Posts: 7
Joined: 1/2/2002
From: Crowborough East Sussex United Kingdom
Status: offline

 
RE: ORDER BY statement - need help! - 6/5/2002 15:05:10   
I have not tested this with FP but if you are looking to use a select statement your code should be something like:-

SELECT Year, Month, Day
FROM TableName
GROUP BY Year,Month, Day
ORDER BY Year DESC , Month DESC , Day DESC;


(in reply to z0diac)
z0diac

 

Posts: 2
Joined: 6/5/2002
From:
Status: offline

 
RE: ORDER BY statement - need help! - 6/6/2002 14:27:15   
Thanks everyone - it was the DESC after each field that was missing (I was using it just at the end... Year,Month,Day DESC which should have been Year DESC,Month DESC,Day DESC




(in reply to z0diac)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> ORDER BY statement - need help!
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts