all groups > sql server reporting services > november 2006 >
You're in the

sql server reporting services

group:

Sum with IIF


Sum with IIF Bruce Lawrence
11/30/2006 11:37:34 AM
sql server reporting services: I'm trying to SUM values using an IF statement.

I have a table that shows employee's time and hours for 3 different
shifts.
The results are grouped so each day I can see the employee total hrs
and also another group that shows the grouped results for a range of
dates.

At the table footer, i'm trying to show the Total Sum of all employees.

Here is my SUM statement
=Sum(IIF(Fields!SHIFT.Value <200, Fields!HOURS.Value,0))

I get an error saying
The value expression for the textbox 'textbox45' uses an aggregate
function on data of varying data types. Aggregate functions other than
First, Last, Previous, Count, and CountDistinct can only aggregate data
of a single data type.
Re: Sum with IIF Kevin
11/30/2006 11:43:53 AM
Do some of the values contain decimals and some not? That might be the
issue. If that's the case, consider casting the values to decimal or
double first. There has to be a function to do that in the conversions
sections of the expression builder.

-Kevin

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