<p>I have some formulas in my reports, and to prevent divsion by zero I do like this in the expression field:</p>

<p>=IIF(Fields!F1.Value &lt;> 0, Fields!F2.Value/Fields!F1.Value, 0)</p>

<p>This normally works fine, but when both F1 and F2 are zero, I get "#Error" in the report, and I get this warning: "The Value expression for the textbox ‘textbox196’ contains an error: Attempted to divide by zero."</p>

<p>Why is that?</p>

IIF() is just a function, and like with any function
all
the arguments  are evaluated
before
the function is called, including
```
Fields!F2.Value/Fields!F1.Value
```
.  In other words, it will attempt to divide by zero in spite of the
```
Fields!F1.Value <> 0
```
condition.