12

I have 3 multivalued parameters in my report.Out of them 2 are optional. Is there any way to get the results in the report with out selecting any from the 2 optional parameters.

My stored proc checks the mulivalued parameters as (States IN (SELECT * FROM Split(@State,',')))

I have done this for a single valued parameter with WHERE CustomerId = @CustId OR @CustId IS NULL.

WorkAround: I selected 'Allow null value', it is throwing this error "A multi-value parameter cannot include null values"

Can anyone point me in the right direction?

user1046415
  • 779
  • 4
  • 23
  • 43
  • See [this answer](https://stackoverflow.com/a/49786027/7794769) for a possible explanation\solution. – stomy Apr 12 '18 at 00:19

1 Answers1

11

Have a look at this article on Passing Multivalued parameters.

Basically the above link contains a workaround to meet your requirement for an optional multivalued parameter. The steps to achieve this are as follows:

  1. Replace "ALL" with " " (BLANK) in the parameter's dataset query.
  2. Assign -1 as default parameter value for your multivalued parameter.
Aftab Ansari
  • 926
  • 9
  • 17