Why isn't my iif statement evaluating true when the condition is correct?
问题 This is my statement: iif(sum(Fields!myfield1.Value) = 0, 0, sum(Fields!myField2.Value)/sum(Fields!myField1.Value)) Any suggestions? 回答1: Likely it is evaluating as True. As mentioned in other comments, you'll get an error anyway because Iif() evaluates all parameter expressions regardless of the result of the test. The error can be avoided by adding another Iif() in the divisor. iif( sum(Fields!myfield1.Value) = 0, 0, sum(Fields!myField2.Value) / iif( sum(Fields!myfield1.Value) = 0, 1, sum