December 15, 2005 at 4:31 pm
Hi
I have three report parameters p1 , p2 and p3.
All 3 are non queried with values Yes and NO .
if p1 is yes only i have to enable the remaining twp params otherwise disable them.
Can some one suggest as to how this can be achieved.
Thanks
December 16, 2005 at 12:39 am
Not saying this is the best way but it is 'a' way...
Make the two subsequent parameters queries that look like the following (BTW, can't remember whether dynamic queries use IIF or IF, so change as appropriate):
=IIF(Parameters!MyParameter1.Value = "Yes", "SELECT 'Yes' AS Option UNION ALL SELECT 'No' AS Option", "SELECT 'NA' AS Option")
THis assumes that:
MyParameter1 is the first parameter (ie the driving parm).
That choosing Yes on MyParameter1 should allow the user to select Yes or No in subsequent parms
Choosing No will return only 'NA' as the only option for subsequent parameters, and you check for this is the main data query.
By executing a select that returns only 1 value (in this case 'NA') you should be able to mod your "real" data query along the lines of
WHERE...... (SomeField = @Parameter2 OR @Parameter2 = 'NA')
This will mean that if Parameter2.Value = 'NA', then effectively SomeField is not filtered, otherwise it's filtered to Yes or No.
HTH (HTIR),
Steve.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply