Order By - Conditional
From: Wes (wharrison_at_adcbarcode.com)
Date: 08/13/04
- Next message: Hugo Kornelis: "Re: Order By - Conditional"
- Previous message: Clark: "SQLExecute error 8162"
- Next in thread: Hugo Kornelis: "Re: Order By - Conditional"
- Reply: Hugo Kornelis: "Re: Order By - Conditional"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 13 Aug 2004 05:04:53 -0700
I wish to include a condition in my order by statement.
i.e. If the value of Field X > Y then Order by Field X,
else Order by Field Z.
I have tried inserting a select case but i cannot get it
to work
Here is an extract from the table
Order_ID Status Name
50 10 Michael
51 10 John
52 10 Peter
53 20 Adam
54 20 Bruce
The condition I would like to apply is as follows:
If Status is greater than 11, Order by Name, else order by
Order_ID
Any help wpuld be greatly appreciated
- Next message: Hugo Kornelis: "Re: Order By - Conditional"
- Previous message: Clark: "SQLExecute error 8162"
- Next in thread: Hugo Kornelis: "Re: Order By - Conditional"
- Reply: Hugo Kornelis: "Re: Order By - Conditional"
- Messages sorted by: [ date ] [ thread ]