you can't do this? @SortBy

D

djc

Thanks for the info.

Chris Hoare said:
Just as an aside you can do a conditional order by clause like this

order by Case When @SortBy1 = '1' Then ContactFirstForename
When @SortBy1 = '2' Then ContactSurname
When @SortBy1 = '3' Then ContactTelephoneSurname
End

Only thing you may need to do is make sure that the typing is consistant;
you cant mix numeric and character fields; but you can have as many
parameters as you like so you can do @SortBY1 = 4 then 'A' and add a sortby2
as neccessary
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top