- Moderator
- #1
I have the following snippet....
... and it doesn't like the commas if I have to order by multiple columns. As you can see, I've tried parenthesis, quotes, etc... neither worked.
Any thoughts?
TIA!
Just my 2¢
"What the captain doesn't realize is that we've secretly replaced his Dilithium Crystals with new Folger's Crystals."
--Greg
Code:
ORDER BY
CASE
WHEN @selSort = '1' THEN Analyte
WHEN @selSort = '2' THEN (Location, CollectionDate, Analyte)
WHEN @selSort = '3' THEN CollectionDate, Analyte
WHEN @selSort = '4' THEN Location, SampleID, Analyte
WHEN @selSort = '5' THEN Location, Analyte, CollectionDate
END
... and it doesn't like the commas if I have to order by multiple columns. As you can see, I've tried parenthesis, quotes, etc... neither worked.
Any thoughts?
TIA!
Just my 2¢
"What the captain doesn't realize is that we've secretly replaced his Dilithium Crystals with new Folger's Crystals."
--Greg