Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / Services / Reporting Services / October 2005

Tip: Looking for answers? Try searching our database.

Update Parameter Value based on another parameter being changed

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kezza - 27 Oct 2005 03:39 GMT
Hi All
I have to parameters they effectively offer 2 methods of finding the same
kind of data.
First the id, second the employee name (with the id as the value)

If a user selects an id then I would like the second parameter's value to
reflect the change(jump to the same record so that they are in synch).

Hope this reads clear
Thanks
Kez
Wayne Snyder - 27 Oct 2005 11:36 GMT
put the first parameter in the 2nd parameters default value... ie

select employeename from emp where id = Parameters!pid.value

see if that does it... otherwise the employee name will not have a default

Signature

Wayne Snyder MCDBA, SQL Server MVP
Mariner, Charlotte, NC

I support the Professional Association for SQL Server ( PASS) and it''s
community of SQL Professionals.

> Hi All
> I have to parameters they effectively offer 2 methods of finding the same
[quoted text clipped - 7 lines]
> Thanks
> Kez
Kezza - 31 Oct 2005 02:47 GMT
Thanks Wayne....
I tried this and in anycase it did not work.  I think as it is the default
value(meaning it is used when no other value has been selected for it,
therefore rendering no change for my selection).
Also I dont think I explained my issue fully.

I have 2 parameters.  1. the employee id 2. the employee name.  They are
using 2 different select statements (This is because I wanted them sorted in
different orders and didn't know how else to do it other that a stored proc)

What I want is when employee id is selected the value of the second
parameter(employee name) changes to equal it.  When the employee name is
selected then I would like the employee id to change value to match this as
well.

Hope this make sense.
Thanks for your help

> put the first parameter in the 2nd parameters default value... ie
>
[quoted text clipped - 13 lines]
> > Thanks
> > Kez
Peter Nolan - 31 Oct 2005 17:35 GMT
Kezza,
as far as I am aware the cascading of parameters only goes in one
direction...top to bottom in the parameters dialog box........i would
suggest that you select on employee id and it fills in employee
name....but if the user selects by employee name leave employee id as
some default value such as '*'.  Then pass both parameters to the
query/stored procedure and the query / sp figures out how to handle
'*'...

I have done this where parameters are dependent on each other but if a
lower level parameter is selected it cannot change the higher level
parameter.....but as far as the query is concerned it does not matter
because the lower level parameter will be applied which will
automatically filter to the higher level parameter in there data...

the higher level parameter stays set as a default...such as '*'...and
is effectively ignored in the stored procedure..

Peter
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.