Yes, it is the common approach. Set the parameter to be multi valued. Then in your dataset where clause use the IN
operator in combination with the parameter name and SSRS will handle the rest. Refer to an example article here. There are other examples available online as well.
How to use IN operator in a query SQL with Reporting Services multi value parameter
I need to create a parameter where user insert a list of values.
The Data Set query have to contain a IN operator on the parameter values
Is it possible?
Many thanks for yuor help
SQL Server Reporting Services
3 answers
Sort by: Most helpful
-
Michael Taylor 60,161 Reputation points
2022-10-12T18:19:11.75+00:00 -
Joyzhao-MSFT 15,631 Reputation points
2022-10-13T01:50:44.087+00:00 Hi @DanieleBarso-1340 ,
When creating a multivalued parameter, the text of the query variable must contain the IN operator, and be sure to include parentheses around the variable, as follows:WHERE Production.ProductInventory.ProductID IN (@ProductID)
See more: Add a multi-value parameter to a paginated report.
Best Regards,
Joy
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread. -
Anonymous
2022-10-14T02:28:27.227+00:00 Hi @Daniele Barso
I can do a simple test for you. Here is my raw data.
Now I want to create a parameter "key" to control "MATCHESPRIMARY", so I add this statement to the query.
After clicking OK, we can find that a parameter "key" appears under Parameters. In its properties box, we may need to set its available values, default values, etc. Since the test I did was relatively simple, I just checked Allow multiple values.
After running, enter "1" and "2", and the data whose MATCHSPRIMARY values are "1" and "2" can be displayed.
For more details, you can refer to this link: add-a-multi-value-parameter-to-a-report.
Best regards,
Aniya