SQL Server 2005 Reporting Services - uses an aggregate function on data of varying data types error

New to Reporting Services and .Net as of yesterday <grin> from many years as a Crystal report user.  

I have this formula in my detail as a column:

= IIf(Fields!AGNGBUKT.Value = 1,Fields!CURTRXAM.Value,0)

Which gives me detail as follows:
Current
0
0
4.55
1.25
0

I am grouping by customer and I want to sum this field at the group level.



=Sum(
 IIf(Fields!AGNGBUKT.Value = 1,Fields!CURTRXAM.Value,0)
 ,"Customer")

if I preview and my column detail results are

0
4.55
1.25
0

I am getting the following error:
[rsAggregateOfMixedDataTypes] The Value expression for the textbox ‘CustCurrentSum’ 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.

if I preview and my column detail results are
1.25
4.55
3.00

My sum works perfectly

After doing some research it looks like because CURTRXAM is a currency field it does not translate the 0 as also being a currency? Instead it is an integer?

So this is really my detail result?

0 integer
1.25 currency
1.65 currency
0 integer

and it is puking trying to summarize what it thinks are different data types?

So how do I indicate that the zero in the following function should be considered a currency type too?

= IIf(Fields!AGNGBUKT.Value = 1,Fields!CURTRXAM.Value,0)

This specific 'manual crosstab' scenario is one I am going to run into extensively trying to translate Reports desinged in Crystal to RS 2005, I appreciate any assistance in understanding the syntax and what exactly isn't working.

Thanks again
Julie
djehmliAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

djehmliAuthor Commented:
I found the answer to my question, in case any other new user to Report Services and .Net runs into the same scenario.


= IIf(Fields!AGNGBUKT.Value = 1,Cint(Fields!CURTRXAM.Value),0)

I had to change the currency field to integer.
GranModCommented:
Closed, 300 points refunded.
GranMod
The Experts Exchange
Community Support Moderator of all Ages

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
DB Reporting Tools

From novice to tech pro — start learning today.