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

Select "All" in parameter dropdown Expand / Collapse
Author
Message
Posted Friday, August 2, 2013 2:57 PM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Yesterday @ 5:36 PM
Points: 442, Visits: 803
I have a stored procedure that selects a list of status' that I am using in a parameter.


Example: Select statusid, statusdescription from status order by statusid

The status are, New, Active, Pending, Terminated.

In my SSRS 2005 report I have a parameter that is populated with the example query.
This works fine but I need an option or a default of "ALL".
Right now there is <select a value>
I need to replace the <select a value> with the word "ALL"

I have tried
select 0, 'All'
union
Select statusid, statusdescription
from status order by statusid

but this throws an error.

I have tried setting the default value in the report for this parameter to "ALL" but does not work.

Can someone show me how to get the Default of "ALL"?

much appreciated.

Gary





Post #1480619
Posted Friday, August 2, 2013 9:21 PM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Yesterday @ 5:36 PM
Points: 442, Visits: 803
I figured out the solution.

Original Query

select 0, 'All'
union
Select statusid, statusdescription
from status order by statusid


Improved query

select 0 as statusid , 'All' as statusdescription

union

Select statusid, statusdescription
from status
order by statusid



Post #1480660
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse