• In order to get round the divide by zero error, I generally do this:

    PF1 AS QF1 / nullif((QF1 + QF2),0),

    instead of

    PF1 AS QF1 / (QF1 + QF2),

    I.e. set the divisor to null, if the divisor is zero.

    I used to do complicated Case statements, but then I needed to retype the divisor.

    This way, I just add "NULLIF(" at the front and ",0)" at the end.

    I'we written about it at Stack overflow

    Best regards,

    Henrik Staun Poulsen

    http://www.stovi.com