This is my statement:
iif(sum(Fields!myfield1.Value) = 0, 0, sum(Fields!myField2.Value)/sum(Fields!myField1.Value))
Any suggestions?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.
Now you’ll get zero if myfield1 is zero and no error is thrown.
(You probably should show ‘N/A’ or just an empty string when the divisor is zero, though.)