I have a SSRS report. there is a long SQL query on the main query, in the last SELECT
I want to filter the results with WHERE
expression, the filter should be with a multi value parameter.
I set the parameter in this way:
- Create a new Dataset with a query.
- Add a new parameter to the Parameters folder (with name NewParam).
Check the "Allow multiple values" checkbox.
Add the parameter to the "Main Query" and set the value with this expression:
=Join(Parameters!NewParam.Value,",")
- At the end of the Main Query I filter the results:
select *
from @FinalStatusTbl
where Test_Number in (@NewParam)
order by Priority
The problem is:
On the report when I choose one value from the list I got expected results, but If I choose multi values the results are empty (not got an error.)
Do you have any idea why?
(When I try this: where Test_Number in ('Test 1', 'Test 2')
it works well).