goofaholix
MIS
I'm doing a report where I need to add up values of the datatype Money.
I found it caused errrors so I have converted Money to Decimal in my query CONVERT(Decimal(10,2),Amount) as Amount.
In my report each column is a different Month, so I want to use this logic =Sum(IIF(Fields!Month.Value=7,Fields!Amount.Value,0)), it displays #Error
To my mind this should work, I've done it hundreeds of times before in SSRS and other reporting packages. I can get it to work by using =Sum(Cdec(IIF(Fields!Month.Value=7,Fields!Amount.Value,0))) but i don't see why I should convert to decimal twice, and I expect it's inefficent to convert 50 fields seperately.
I've also tried =Sum(IIF(Fields!Month.Value=7,Fields!Amount.Value,0.00)).
Any ideas what I'm doing wrong?
Thanks.
Bruce
I found it caused errrors so I have converted Money to Decimal in my query CONVERT(Decimal(10,2),Amount) as Amount.
In my report each column is a different Month, so I want to use this logic =Sum(IIF(Fields!Month.Value=7,Fields!Amount.Value,0)), it displays #Error
To my mind this should work, I've done it hundreeds of times before in SSRS and other reporting packages. I can get it to work by using =Sum(Cdec(IIF(Fields!Month.Value=7,Fields!Amount.Value,0))) but i don't see why I should convert to decimal twice, and I expect it's inefficent to convert 50 fields seperately.
I've also tried =Sum(IIF(Fields!Month.Value=7,Fields!Amount.Value,0.00)).
Any ideas what I'm doing wrong?
Thanks.
Bruce