i'm using sql server 2005 reporting services create new report.
this report has 2 optional parameters can selected users or users can leave them blank. both dropdown selection.
the problem i'm facing is, had set both parameters allow null value, not allow blank value. when click on view report button without select filter criteria, report give me 0 records. if selected value both dropdown selection, reports give me result.
@package
varchar(100)
, @plant
tinyiny
.
i write where
clause in way. please , appreciate.
where (@package ='' or package_type '%' + @package + '%') , (@plant null or plant_id = @plant )
so when no filter criteria selected, both @package
, @plant
null
?
in where
clause above, you're handling @plant
null
values.
you need check null
@package
, too, like:
where (@package null or @package ='' or package_type '%' + @package + '%') , (@plant null or plant_id = @plant )
Comments
Post a Comment