|
| |
|
|
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%>
|
|
|
|
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."
|
|
|
|
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;
|
|
|
|
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
|
|
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
|
|
|