I'm just starting with SSRS and I have an expression that gives me the sum that I'm looking for, but I still get the warning:
Warning 1 [rsAggregateOfMixedDataTypes] The Value expression for the textrun ‘Textbox83.Paragraphs.TextRuns’ 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.
This is my current expression:
=sum(Cdec(iif(Fields!UserField1.Value = 1, (Fields!UserField2.Value), Cdec(0))))
I've tried various types of conversion as well as code and no matter what I do I get that warning message.
UserField1.Value will be either a 0 or 1
UserField2.Value is a Decimal value and can be NULL although looking at the database there are no nulls, but there are Zeros.
Like I said I'm getting the right totals, but this is a test database and not very large. I'm concerned that this will cause issues down the road. Any ideas?