Please start any new threads on our new site at 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
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 Assignt to right value to the corresponding rows
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

11 Posts

Posted - 12/13/2012 :  15:15:30  Show Profile  Reply with Quote
if my table is like this in my database

Student Staff children
34 104 playing
34 104 playing
34 104 rugby
34 104 soccer
34 104 playing

i want the value 34 to assign only to playing, if rugby or soccer it should be 0 or empty set and staff(1024) to assign only to rugby and soccer.i was wondering can i do this in my expression if i have =Fields!XXX.value. if not how can i write this in query.i query and display my tables as this.which is fine.and value of 34 and 104 a constant value.

my final table result i want to be like this

Student Staff children
34 0 playing
34 0 playing
0 104 rugby
0 104 soccer
34 104 playing

thanks in advance

Very Important crosS Applying yaK Herder

52326 Posts

Posted - 12/14/2012 :  03:18:39  Show Profile  Reply with Quote
=IIF(Fields!children.value = "playing",Fields!Student.value,0)
for student and
=IIF(Fields!children.value = "rugby" Or Fields!children.value = "soccer",Fields!Staff.value,0)
for Staff

SQL Server MVP

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.03 seconds. Powered By: Snitz Forums 2000