Meg Bobo
Meg Bobo

Reputation: 43

How do I add a "Select All" option in SQL Server Report Builder without checking "allow multiple values?"

I have a report with a state parameter (integer). The report shows different data based on what state is selected. I would like to add a "Nationwide" option, but I don't want to check "allow multiple values" because there is no need to select multiple states for this report.

Upvotes: 0

Views: 888

Answers (1)

Ronaldo Cano
Ronaldo Cano

Reputation: 925

just add a new value to your patameter query or new item, label "Nation Wide" and value -1, then in your query if the parameter is equals to -1 don't use a where clause

if @parameter = -1
 begin
   select *
   from table
 end 
else 
 begin
   select *
   from table where
   status = @parameter
 end 

enter image description here

Upvotes: 1

Related Questions