Saturday, February 25, 2012

Parameters - A OR B

Probably a pretty easy question: How do I implement 2 parameters in a OR situation? I want the users to be able to either choose a value for A OR a value for B, i.e. select the product name OR the product code. I have 3 datasets defined, 1 for each parameter and 1 for the report output. The last one has ...WHERE A=@.A or B = @.B. When testing, it seems to require both. I want them to be mutually exclusive, the user can only pick one.Hi,

you probably would be able to make one parameter disbled (using a dependency) if the one is chosen, but you won′t be able to do this for bither having circular references. What you can do is to implement both parameters in your report and make them selectable in the GUI and implement the logic for differenting the cases in the query code.

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de|||

Thanks for the information. I did some research and I updated my query's WHERE clause: WHERE (D.name = ISNULL(@.name, D.name)) AND (D.tracking_number = ISNULL(@.tracking_number, D.tracking_number))

I also checked the "allow null value" for each of the 2 parameters. I also have the default value to be null. However, if I only select a name, I'm still getting the prompt: Please select a value for the parameter 'Tracking Number'.

Any ideas what else I need to do? I thought the "allow null value" would do it.

|||

I had somewhat-similiar report

User pick a date range, and pick which date column to use (data is coming from a Stored Proc)

I can't think of an easy way to do it in StorProc unless I copy code twice (once for each date column), or dynamic query

so I used the filter in SSRS, on the table

=IIF(Parameters!UseImportedDateRange.Value = "Imported", Fields!ImportedDate.Value, Fields!MostRecentCallDate.Value)

> @.start_date

No comments:

Post a Comment