Reputation: 31
I need to sum two fields but I couldn't.
Can you help me?
=iif(Fields!ABC.Value= "", Nothing, Sum(Fields!PA.Value))
=iif(Fields!XYZ.Value= "", Nothing, Sum(Fields!PA.Value))
It does not work that way:
=iif(Fields!ABC.Value= "", Nothing, Sum(Fields!PA.Value)) +
iif(Fields!XYZ.Value= "", Nothing, Sum(Fields!PA.Value))
Upvotes: 1
Views: 6898
Reputation: 3399
I think what he is looking for is something like this:
=Sum(IIF(Fields!ABC.Value = "", Nothing, Fields!PA.Value)
=Sum(IIF(Fields!XYZ.Value = "", Nothing, Fields!PA.Value)
Upvotes: 0
Reputation: 136219
To sum them I should think you just want to default to 0
rather than Nothing
=iif(Fields!ABC.Value= "", 0, Sum(Fields!PA.Value)) +
iif(Fields!XYZ.Value= "", 0, Sum(Fields!PA.Value))
Upvotes: 4