Expression divide by 0 returns #Error

  • Hi All,

    I am new to SQL

    I added a calculated field to my dataset with and expression to calculate efficiency

    My expression is as follows: =Fields!EstTotLbrHrs.Value/Fields!ActTotLbrHrs.Value

    In some cases my value for ActTotLbrHrs is 0, so it returns #Error

    How do I return "N/A" for fields with ActTotLbrHrs = 0

    Thanks in advance

  • If I remember expressions correctly, try using IIF to check if the denominator is zero. If it is, return NA, else return the division.



    Alvin Ramard
    Memphis PASS Chapter[/url]

    All my SSC forum answers come with a money back guarantee. If you didn't like the answer then I'll gladly refund what you paid for it.

    For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply