Groups | Blog | Home
all groups > sql server reporting services > september 2005 >

sql server reporting services : Conditional iif statement


DigitalVixen
9/12/2005 8:06:01 AM
Ok I have a sp that returns a number of records, each identfied as being part
of a group based on the Type field.

Type Name Amount
1 Test1 1.00
1 Test2 1.00
2 Test3 2.00
3 Test4 3.00

What I am using is iff(Type.value = 1, Price.value, 0) When I do this it
works fine but when I use them middle records iff(Type.value = 2,
Price.value, 0) it displays 1.00 as the price for type 2, and it should
display 2.00 for type 2.

Any help is greatly apprciated. Also, due to the formatting specifics I am
using single textboxes instead of a table or list.

Wayne Snyder
9/13/2005 4:48:04 AM
Try this...

=iif(Fields!Type.Value=1, Fields!Price.Value,0)
the same with Value =2



--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)

I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org

[quoted text, click to view]

DigitalVixen
9/13/2005 5:52:02 AM
Sorry for the typo's but that is exactly what i am using and it is giving me
the first record's price only.

[quoted text, click to view]
David Bienstock
9/20/2005 9:47:04 AM
Can't you go back to a table and simulate the look & feel? I think if you
did it in the detail row it would pull the right values.
--
"Everyone knows something you don't know"


[quoted text, click to view]
DigitalVixen
9/23/2005 12:52:03 PM
Hi David,

Thank you for the reply, however I don't understand what is meant by
"simulate the look & feel", can you please be a little more specific?

Thanks

[quoted text, click to view]
AddThis Social Bookmark Button