AMani
AMani

Reputation: 11

Case Statement in SQL Server which can be used in SSRS

I need to write a query in the following way

SELECT     
    CASE WHEN @Show_Subtotals = 'False' THEN 'True'  
         ELSE <This is what i needed figured out> (True or False) 
    END AS HideDetails

I am not sure how to display multiple value in the else. I am using this sql statement as Datasource for a SSRS report which has cascading parameters.

Thanks!

Upvotes: 0

Views: 763

Answers (1)

user359040
user359040

Reputation:

Assuming you want to display True only when @Show_Subtotals is False, and both True and False (as separate options) when @Show_Subtotals is True, try:

select 'True' AS HideDetails UNION ALL
select 'False' AS HideDetails WHERE @Show_Subtotals = 'True'

Upvotes: 1

Related Questions