Re: Order By question
- From: "MP" <nospam@xxxxxxxxxx>
- Date: Wed, 1 Nov 2006 17:20:58 -0600
"Dmitriy Antonov" <antonovdima@xxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:eKuoLLg$GHA.2128@xxxxxxxxxxxxxxxxxxxxxxx
AH HA! You *DO* understand!
:-)
Is there a way to do that via sql?
another way of saying the same thing...via very "pseudo" code
If F1 = '1n' Or F1 = '4B' then
'Order By F2'
Else
...some sql to produce the posted results for '2L' and '3R'
For Each Distinct F2
'Order By F1
Next F2
End If
Try this query:
Select F1, F2
From (
Select F1, F2,
IIf(F1='1n', 1, IIf(F1='4b',3,2)) As Ord1,
IIf(F1='1n' or F1='4b', F1, 100-Val(F2)) As Ord2
From TableName
)
Order By Ord1, Ord2, F1, F2 Desc
Dmitriy.
Thanks Dmitriy,
I'll look into that.,
I was hoping you'd stop by
:-)
Thanks
Mark
.
- Follow-Ups:
- testing
- From: Mitko Iliev
- testing
- References:
- Order By question
- From: MP
- Re: Order By question
- From: Jan Hyde
- Re: Order By question
- From: MP
- Re: Order By question
- From: Dmitriy Antonov
- Order By question
- Prev by Date: Re: Order By question
- Next by Date: Re: Ado Recordset and stored procedure(SQL server 2000)
- Previous by thread: Re: Order By question
- Next by thread: testing
- Index(es):
Relevant Pages
|