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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Assign Labels to Values in Table Column (MS SQL SSRS) 1

Status
Not open for further replies.

afelissimo

Instructor
Sep 2, 2010
12
US
I have a table column called status. Its values can only be "O" or "C." In my report, I would like it to show as "open" or "closed." How do I update my query to do this?
 
Well, you could have in your query:

CASE [status]
WHEN 'O' THEN 'open'
ELSE 'closed'
END AS statusdesc

This defaults all non-'O' values to display 'closed'; you may not want to do that if you could also have NULL values there; add WHEN clauses as needed to handle wnat contingencies you want to.

Then just use 'statusdesc' in your dataset on the report.
 
jjefferson,

Thanks for the reply! After a lot of research, I finally came to the same result. I put the CASE sequence in my WHERE clause of the data query. Because I wanted to use "Status" as a parameter, I also had to add it to the SELECT clause of my parameter query. I used DISTINCT in the parameter query to avoid having 12 "closed" and 12 "open" choices in the prompt on the interface.

On the interface, the status field is a checkbox, so there are only two possible results. No problems there.

It was such a relief when it worked.
Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top