Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I mix Asc & Desc in Sort Expression?

Status
Not open for further replies.

dianemarie

Instructor
Jul 11, 2001
583
US
Hello, SSRS 2005. I am using a sort expression on a group. In English: If @Parameter = "A", then sort by Field1 ASC else if @Parameter = "B" then sort by Field2 DESC. This doesn't seem possible in the sort properties of the group, as the Direction does not allow expression. I'm wondering if I can create a calculated field and then sort on that. Any help is appreciated. Thanks much.
 
Try
Code:
order by
case when @Parameter = "A" then field1 end asc,
case when @Parameter = "b" then field1 end desc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top