Friday, March 30, 2012

Report Parameters

I am using report parameters that are non-queried. I want one parameter
label to be "All" and I want it to act as a wildcard. I tried giving it a
value of % and setting the Data Type to String instead of integer. It didn't
work though. What value will act as a wildcard and include all integers
pulled from my database.Chandler,
If it is only one parameter that you want to act as "all" only, then you can
just not use it at all... By default all records will be selected.
If it is a parameter of type integer that can have
- either integer values, which will filter by that specific value
- or something that will mean "all" - here, you could use blank or null
for that purpose.
And the where clause could look like that:
where [...] and YourIntField like (case when Isnull(@.YourIntParam,0) = 0
then '%' else @.YourIntParam end)
This will work, of course, if there are no values of zero in your field (I
mean if you don't pass on purpose the value zero for the parameter).
Otherwise, just choose a different value to compare to, instead of 0.
HTH,
Andrei.
"Chandler" <Chandler@.discussions.microsoft.com> wrote in message
news:137E11DC-3EE7-4DC8-B6D4-BF4607A7E585@.microsoft.com...
> I am using report parameters that are non-queried. I want one parameter
> label to be "All" and I want it to act as a wildcard. I tried giving it a
> value of % and setting the Data Type to String instead of integer. It
didn't
> work though. What value will act as a wildcard and include all integers
> pulled from my database.

No comments:

Post a Comment