Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 select parametr

Author  Topic 

nord
Posting Yak Master

126 Posts

Posted - 2013-02-12 : 14:13:51
Hi,
I have sp for parametr and this is result sp,i need make parametr and user can choise or all value without 'gross'or just 'gross'
how i can do it?
thanks


Value Name
BENJAM BENJAM
DIRECT DIRECT
GROSS GROSS
HDS RNA HDS RNA
INDIGO INDIGO
LOG/TAL LOG/TAL
QUEBEC QUEBEC
RMDIST RMDIST
XMAG XMAG

James K
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2013-02-12 : 15:36:15
I didn't follow your requirements completely. Based on what I understood: write just one query to include the gross and in the report hide or show the gross column based on based on the users's selection. That is probably the simplest, unless computing the gross is an expensive operation and so you want to avoid doing that unless the user specifically asked for it.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-02-13 : 04:42:16
Is parameter a multivalue one? So when GROSS is selected you dont want to allow other values? Is that the requirement?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

nord
Posting Yak Master

126 Posts

Posted - 2013-02-13 : 09:37:19
no,I need when user select ,can select just 'gross gross' or all together without 'gross gross '
Thanks
Go to Top of Page

Alan Schofield
Starting Member

23 Posts

Posted - 2013-02-26 : 23:01:30
[code]
CREATE PROC myProc(@JustGross bit)
AS
SELECT Value, Name
FROM myTable
WHERE (Name = 'GROSS' AND @JustGross=1)
OR (Name != 'GROSS' AND @JustGross=0)
[/code]

Calling with @JustGross parameter = 1 will show just GROSS GROSS, calling it with @JustGross parameter = 0 will show everything EXCEPT GROSS GROSS
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-02-26 : 23:06:00
I dont think the question was on the display of parameter values within list
what i understood was way to allow user to select only 'gross gross' or all except 'gross gross ' from parameter list.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -