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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

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

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Using a field within a field for a value?
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

JGaston
Starting Member

USA
8 Posts

Posted - 09/11/2013 :  17:28:51  Show Profile  Reply with Quote
Hi and thanks for helping an amateur.

I want to use a value like this:

=Fields!wghtX.Value

but the X should be replaced the value of another field:

=Fields!palletNum.Value

so...

for palletnum 1 i would get wght1
for palletnum 2 i would get wght2
for palletnum 3 i would get wght3
and so on...

any help would be wonderful! thanks!

-Jesse

James K
Flowing Fount of Yak Knowledge

3873 Posts

Posted - 09/11/2013 :  17:43:53  Show Profile  Reply with Quote
As far as I know, SSRS does not support dynamic values for field identifiers. If the palletnum's are a known set, you could use a SWITCH expression. That is the best I can think of.

Another option would be to modify your underlying SQL query to return the data in the correct form in a single column - i.e., wght1 for pallenum = 1, wght2 for pallentnum=2 and so on.
Go to Top of Page

JGaston
Starting Member

USA
8 Posts

Posted - 09/11/2013 :  19:19:04  Show Profile  Reply with Quote
thanks a bunch man. was able to use the switch expression to get what i needed. really appreciate it.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52326 Posts

Posted - 09/12/2013 :  16:32:36  Show Profile  Reply with Quote
you can always make a parameter say XValue and map it to a dataset which returns palletNum values (1,2,3..). then you can simply use

=Fields("wght" & Cstr(Parameters!XValue.Value)).Value

in the expressions

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
  Previous Topic Topic Next 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.05 seconds. Powered By: Snitz Forums 2000