Msg 8134, Level 16, State 1, Line 1,Divide by zero error encountered.,Warning: Null value is eliminated by an aggregate or other SET operation.

  • Lynn Pettis (1/27/2010)


    lmu92 (1/27/2010)


    Seems like I totally missed the point. Sorry about that... :blush:

    Okay, I'm lost on how you are lost. Please, what did you miss? It was your post that I based my response on that seemed to fix the problem.

    I thought of using ISNULL() as a replacement of NULLIF() which was a wrong recommendation for the given scenario.

    The solution I proposed can only be used to eliminate the division by NULL but not the division by Zero.

    Since the OP stated to have both error messages I finally figured that "I missed the point" (= did not consider all information provided & used the wrong function).

    Regarding laying the base for your post: All I did was extracting the code snippet I thought to be the root cause of the error. But my conclusion was wrong.



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • lmu92 (1/27/2010)


    Lynn Pettis (1/27/2010)


    lmu92 (1/27/2010)


    Seems like I totally missed the point. Sorry about that... :blush:

    Okay, I'm lost on how you are lost. Please, what did you miss? It was your post that I based my response on that seemed to fix the problem.

    I thought of using ISNULL() as a replacement of NULLIF() which was a wrong recommendation for the given scenario.

    The solution I proposed can only be used to eliminate the division by NULL but not the division by Zero.

    Since the OP stated to have both error messages I finally figured that "I missed the point" (= did not consider all information provided & used the wrong function).

    Regarding laying the base for your post: All I did was extracting the code snippet I thought to be the root cause of the error. But my conclusion was wrong.

    But you isolated what was important. I took a quick look at the code and simply asked for table def's, sample data, expected results.

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

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