Quantcast
Channel: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 4871

SSRS Optional Parameters

$
0
0

Hello spiceheads,

In SQL Server Management Studio I created a report query with a custom Where clause which works perfectly, see below.

WHERE Total <> 0 AND CASE WHEN (EmpType = @Where1 or @Where1 Is Null) THEN 1 ELSE 0 END = 1 AND CASE WHEN (WorkType = @Where2 or @Where2 Is Null) THEN 1 ELSE 0 END = 1

What this does is filter the Employee Type and or the Work Type IF the user chooses to filter. So far so good.

In SSRS when I open the query and run it, it also works, still good.

When I launch the report, it insists I have values selected for Employee Type and Work Type. I have set the parameters to type text, allow null and allow blank, I have set a default value of null for each parameter.

What am I missing?

Thanks


Viewing all articles
Browse latest Browse all 4871

Trending Articles