Thursday, February 9, 2012

Adding ALL to a query.

Ok I have a parameter on a report.
It list all the Agencys we have.
The person who runs the report selects all the agencies they wont on the
report.
THE PROBLEM:::
There are over 400 agencies!!!!!!!
This is what I wont to do.
I wont to add "ALL*" to the query after it creates the agencies list.
I wont to be able to select "ALL*" and that will make the query select all
the agencies in the list. then run the report.
Is this posible'
Scott Burke
SQL2005
Microsoft Visual Studio 2005Add a value called 'All' to your parameter list. If your parameter is based
on a query then do this:
select 'All' as label, 'All' as value UNION select somefield as label,
someotherfield as value
Then in your query do this:
select * from sometable where (yourfield = @.Param or @.Param = 'All)
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Scott Burke" <ScottBurke@.discussions.microsoft.com> wrote in message
news:21AA81FF-08F0-4540-BD25-4C0A112957EB@.microsoft.com...
> Ok I have a parameter on a report.
> It list all the Agencys we have.
> The person who runs the report selects all the agencies they wont on the
> report.
> THE PROBLEM:::
> There are over 400 agencies!!!!!!!
> This is what I wont to do.
> I wont to add "ALL*" to the query after it creates the agencies list.
> I wont to be able to select "ALL*" and that will make the query select all
> the agencies in the list. then run the report.
> Is this posible'
> Scott Burke
> SQL2005
> Microsoft Visual Studio 2005|||If the drop-down list on the report is a multi-valued parameter then there
should already be a "Select All" option on your drop down...
"Scott Burke" wrote:
> Ok I have a parameter on a report.
> It list all the Agencys we have.
> The person who runs the report selects all the agencies they wont on the
> report.
> THE PROBLEM:::
> There are over 400 agencies!!!!!!!
> This is what I wont to do.
> I wont to add "ALL*" to the query after it creates the agencies list.
> I wont to be able to select "ALL*" and that will make the query select all
> the agencies in the list. then run the report.
> Is this posible'
> Scott Burke
> SQL2005
> Microsoft Visual Studio 2005

No comments:

Post a Comment