SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 select parametr
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

nord
Posting Yak Master

122 Posts

Posted - 02/12/2013 :  14:13:51  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

3559 Posts

Posted - 02/12/2013 :  15:36:15  Show Profile  Reply with Quote
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

India
52309 Posts

Posted - 02/13/2013 :  04:42:16  Show Profile  Reply with Quote
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

122 Posts

Posted - 02/13/2013 :  09:37:19  Show Profile  Reply with Quote
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

United Kingdom
23 Posts

Posted - 02/26/2013 :  23:01:30  Show Profile  Reply with Quote

CREATE PROC myProc(@JustGross bit)
AS
SELECT Value, Name 
   FROM myTable
   WHERE (Name = 'GROSS' AND @JustGross=1)
      OR (Name != 'GROSS' AND @JustGross=0)


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

India
52309 Posts

Posted - 02/26/2013 :  23:06:00  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000