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.
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?thanksValue NameBENJAM BENJAM DIRECT DIRECT GROSS GROSS HDS RNA HDS RNAINDIGO INDIGO LOG/TAL LOG/TALQUEBEC 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. |
|
|
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 MVPhttp://visakhm.blogspot.com/ |
|
|
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 |
|
|
Alan Schofield
Starting Member
23 Posts |
Posted - 2013-02-26 : 23:01:30
|
[code]CREATE PROC myProc(@JustGross bit)ASSELECT 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 |
|
|
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 listwhat i understood was way to allow user to select only 'gross gross' or all except 'gross gross ' from parameter list.------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|
|
|