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

sql server reporting services : is this basic syntax correct?


Immy
12/2/2005 12:29:18 PM
Hi all,

I am trying to perform what would seem to be a very simple conditional check
but it never works!
I always end up with an empty value.
=SUM(IIF(Fields!Ticket.Value = 'Student', Fields!Quantity.Value =0,
Fields!Quantity.Value))

What I am hoping for in the result is that if there is a 'Student' in the
result set, when totalling, it should set that Quantity value to 0, but
continue to sum up the other values.

Any help appreciated.
Immy

toolman
12/5/2005 9:05:04 AM
Try
=SUM(IIF(Fields!Ticket.Value = "Student", 0,
Fields!Quantity.Value))
or
create a calculated field with
=IIF(Fields!Ticket.Value = "Student", 0,
Fields!Quantity.Value) as the expression and then sum the calculated
field.

Enter make sure to use double quotes SQLRS is real picky.
AddThis Social Bookmark Button