SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Hide/Show parameter based on another parameter


Hide/Show parameter based on another parameter

Author
Message
jamey8420
jamey8420
SSC Journeyman
SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)

Group: General Forum Members
Points: 89 Visits: 135
Is there a way to conditionally hide or show a parameter based on another parameter answer?

I have one parameter that is a list of different report types:

Type A
Type B
Type C

Report Type C has a budget amount associated with it, while A and B do not. If Type C is chosen, I'd like to have another parameter for budget amount to display.


I'm pretty certain that I can't hide/show a parameter based on another parameter, but maybe I'm wrong.

If I can't do that, I'd still like that budget amount to only apply towards report Type C. The only way I can think to do that would be two queries:

IF rpt_type = 'Type C'
BEGIN
select * from reports where rpt_type = @rpt
and budget >= @budget
END
ELSE
BEGIN
select * from reports where rpt_type = @rpt
END

I would prefer to not do this, but I can't think of a more elegant way to handle it. Any thoughts? Thanks!
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search