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
 SQL Server Development (2000)
 Dynamic Order By clause

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-02-16 : 08:07:40
Andy writes "When I use Case in the dynamic Order by clause as suggested in one of your articles e.g

order by CASE WHEN @SortedBy = 1 THEN L.BUs , L.MUs, L.Countries
WHEN @SortedBy = 2 THEN M.EBAAccess
END

It through up an error! It doesn't seem to allow more than 1 field to order by when using case! Is this correct? Or is there a way around this?

Cheers

Andy"
   

- Advertisement -