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

Parameter help Expand / Collapse
Author
Message
Posted Tuesday, October 29, 2013 11:17 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Tuesday, October 28, 2014 11:57 AM
Points: 25, Visits: 186
Hi,

I have a SSRS report with four parameters,and I want to be able to enter information for two of the parameters and run the report opposed to all four of them. However, when I select allow blanks and only select the parameters that I want to run the report by, the report comes back blank

Essentially, I want to be able to the run report by different parameters without having to enter information for all parameters at the same time.

What is the correct way of going about this?

Thanks!
Post #1509484
Posted Wednesday, October 30, 2013 1:58 AM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: 2 days ago @ 12:51 AM
Points: 3,171, Visits: 1,379
Briceston (10/29/2013)
Hi,

I have a SSRS report with four parameters,and I want to be able to enter information for two of the parameters and run the report opposed to all four of them. However, when I select allow blanks and only select the parameters that I want to run the report by, the report comes back blank

Essentially, I want to be able to the run report by different parameters without having to enter information for all parameters at the same time.

What is the correct way of going about this?

Thanks!


Please post the query for the dataset. If the report executes then the parameters are allowing blanks / nulls. Usually something like :

Select ...
From ....
Where Colour = @Colour

If @Colour allows blanks then only rows with blank '' will match.

Try:

Select ...
From ....
Where Colour = @Colour or @Colour = ''

Fitz



Post #1509674
Posted Thursday, October 31, 2013 7:32 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Tuesday, October 28, 2014 11:57 AM
Points: 25, Visits: 186
Mark, thanks for replying. Your example logic below was very helpful. After I introduced into my logic, the report runs fine.

Thanks.

Mark Fitzgerald-331224 (10/30/2013)
Briceston (10/29/2013)
Hi,

I have a SSRS report with four parameters,and I want to be able to enter information for two of the parameters and run the report opposed to all four of them. However, when I select allow blanks and only select the parameters that I want to run the report by, the report comes back blank

Essentially, I want to be able to the run report by different parameters without having to enter information for all parameters at the same time.

What is the correct way of going about this?

Thanks!


Please post the query for the dataset. If the report executes then the parameters are allowing blanks / nulls. Usually something like :

Select ...
From ....
Where Colour = @Colour

If @Colour allows blanks then only rows with blank '' will match.

Try:

Select ...
From ....
Where Colour = @Colour or @Colour = ''

Fitz



Post #1510167
Posted Thursday, October 31, 2013 8:18 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, October 28, 2014 12:50 PM
Points: 1,061, Visits: 2,580
Briceston (10/31/2013)
Mark, thanks for replying. Your example logic below was very helpful. After I introduced into my logic, the report runs fine.

Thanks.

Mark Fitzgerald-331224 (10/30/2013)
Briceston (10/29/2013)
Hi,

I have a SSRS report with four parameters,and I want to be able to enter information for two of the parameters and run the report opposed to all four of them. However, when I select allow blanks and only select the parameters that I want to run the report by, the report comes back blank

Essentially, I want to be able to the run report by different parameters without having to enter information for all parameters at the same time.

What is the correct way of going about this?

Thanks!


Please post the query for the dataset. If the report executes then the parameters are allowing blanks / nulls. Usually something like :

Select ...
From ....
Where Colour = @Colour

If @Colour allows blanks then only rows with blank '' will match.

Try:

Select ...
From ....
Where Colour = @Colour or @Colour = ''

Fitz





Hi Briceston and Mark Fitzgerald-331224,

The query Mark Fitzgerald-331224 suggested is an example of what's come to be called a "catch-all query". It can have a serious impact on the database performance. Here's a seminal article on catch-all queries that explains the problem and how to avoid it:

http://sqlinthewild.co.za/index.php/2009/03/19/catch-all-queries/


Jason Wolfkill
Blog: SQLSouth
Twitter: @SQLSouth
Post #1510201
Posted Thursday, October 31, 2013 8:28 AM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: 2 days ago @ 12:51 AM
Points: 3,171, Visits: 1,379
Agreed WolfKillJ. I was providing a quick fix suggestion to the issue and would liked to have seen the dataset query to evaluate other options such as dynamic SQL as suggested in the linked article.

Fitz
Post #1510209
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse