Wednesday, March 28, 2012

Report Parameter- 'All'

I am trying to make a report parameter that allows the user to select one of three values. Two of the values are what;s stored in the view's field right now: (as char 1) 'O' (open) or 'C' (closed). I need to add the choice 'All' that will show BOTH open and closed.

I made a dataset for the parameters as

select distinct valve_position

from view monitoring

where (not(valve_position is null))

Of course, that only yields choices of O or C, so I changed it to

select distinct valve_position , ''

from view monitoring

where (not(valve_position is null))

union

select 'All', -1

Then I changed the base query dataset to include

where valve_position = @.valve or valve_position = -1

When I run the report, O and C work, but All doesn't retrieve any records.

How do I something so simple? Of course, I see MSRS 2005 has a multi value check box...

Thanks for any help.

The comparisong valve_position = -1 should be @.valve = -1

For details about multivalue parameters please look at http://msdn2.microsoft.com/en-US/library/ms155917(SQL.90).aspx

|||Thank you!!! That worked!

No comments:

Post a Comment