2
votes

In my SSRS 2008 R2 report I have a multi-value @Status parameter. This is the dataset:

SELECT 1 AS ID, Description
FROM [ApplicationStatus]
WHERE StatusID IN (5, 6, 11, 14)
UNION
SELECT 2 AS ID, Description
FROM [ApplicationStatus]
WHERE StatusID IN (10)

In my main ReportData dataset I have the following filter:

WHERE ((@Status IN (1) AND a.StatusID IN (5, 6, 11, 14)) 
OR (@Status IN (2) AND a.StatusID IN (10)))

The report runs fine when selecting either 1 and 2 as the value in the @Status drop-down, but when I select the built-in '(Select All)' option, I get the following error message:

Query execution failed for dataset 'ReportData'. An expression of non-boolean type specified in a context where a condition is expected, near ','.

1
sql server multi value add select All option so instead of that you can try simple dropdown to filter recordKevin Shah

1 Answers

3
votes

The multiple values are in @Status, therefore @status needs to be after IN, not before.

WHERE (( 1 IN (@Status)  AND a.StatusID IN (5, 6, 11, 14)) 
OR (2 In (@Status) AND a.StatusID IN (10)))