Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Order By problem!

Author  Topic 

mibheenick
Starting Member

12 Posts

Posted - 2005-09-12 : 01:22:45
Hi everyone!
btw thanx for last time Madhivanan

here's my little problem. I wanna get the records in the order i specify in the last line of the query! As it is, the query does not run, it gives me an error.

Declare @LangueClient as varchar(2)
select @LangueClient = 'DE'
select * from TexteImpression
where CodeImpression = 1328 and RangImpression = 9
and CodeLangue in (@LangueClient, 'fr', 'EN')
order by CodeLangue (@LangueClient, 'fr', 'EN')

Thanx in advance...

I leave it to god.....

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-09-12 : 01:30:11
>>btw thanx for last time Madhivanan

Thanks

I think you need something like this

Order by case when CodeLangue = @LangueClient then 1 when CodeLangue ='fr' then 2
when CodeLangue ='EN' then 3 end

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -