I'm using SQL Server 2005 Reporting Services to create a new report.
This report has 2 optional parameters that can be selected by users or users can leave them blank. Both are dropdown selection.
The problem that I'm facing is, I had set both parameters to Allow Null Value, but not Allow Blank Value. When I click on View Report button without select any filter criteria, the report give me 0 records. But if I selected a value for both dropdown selection, the reports give me result.
@Package
is varchar(100)
and @Plant
is tinyiny
.
I write the WHERE
clause in this way.
please help and much appreciate.
WHERE (@Package ='' OR PACKAGE_TYPE LIKE '%' + @Package + '%') AND
(@Plant IS NULL OR PLANT_ID = @Plant )