Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

NO Filters in DataSet if Variable is Null Expand / Collapse
Author
Message
Posted Tuesday, February 11, 2014 7:07 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, April 10, 2014 7:22 AM
Points: 163, Visits: 566
Hi I have a Dataset In SSRS Report and I added Filters with my condiation as = @Variable .
I am getting the results as expected for my condition . If my variable is NULL i need to retrive all my rows with out filter ,So can one suggest with an idea Thanks in advance
Post #1540521
Posted Tuesday, February 25, 2014 7:53 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, April 03, 2014 6:23 AM
Points: 1,135, Visits: 1,149
RamSteve (2/11/2014)
Hi I have a Dataset In SSRS Report and I added Filters with my condiation as = @Variable .
I am getting the results as expected for my condition . If my variable is NULL i need to retrive all my rows with out filter

You could do something like:
WHERE condition = COALESCE(@Variable, condition)

That way, if the variable is Null, in essence you're saying 1 = 1, which is always true.

HTH,
Rob
Post #1544934
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse