none
=IIF Expression returns divide by 0 error when calculation should not be done. RRS feed

  • Question

  • I'm trying to avoide dividing by 0 with the follwing expression.
    =IIf(Fields!ly_rev.Value<>0,((Fields!ty_rev.Value-Fields!ly_rev.Value)/Fields!ly_rev.Value),0)

    returns Warning 1 [rsRuntimeErrorInExpression] The Value expression for the textrun ‘Textbox26.Paragraphs[0].TextRuns[0]’ contains an error: Attempted to divide by zero.

    It seems like RS is doing the calculation before doing the IIF test.  What other way can I do this?

    Thanks,

    Steve

    Wednesday, July 1, 2009 6:20 PM

Answers