Results 1 to 6 of 6
  1. #1
    Lounger
    Join Date
    Apr 2008
    Location
    Jacksonville, North Carolina, USA
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hello All

    I was wondering if there was a quick fix for the division by zero situation

    I had a query i bult in access 2003 we since have upgraded to 2007 so I migrated the database over to that one and everything works except that one query, it gives the division by zero error. But if I open it in 2003 it works. wierd

    Has any body else had this problem and how do you fix it.

    Thanks ahead of time.

    Matt

  2. #2
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post
    [quote name='Bighale' post='793572' date='16-Sep-2009 19:54']Hello All

    I was wondering if there was a quick fix for the division by zero situation

    I had a query i bult in access 2003 we since have upgraded to 2007 so I migrated the database over to that one and everything works except that one query, it gives the division by zero error. But if I open it in 2003 it works. wierd

    Has any body else had this problem and how do you fix it.

    Thanks ahead of time.

    Matt[/quote]
    Matt

    Could you change the query/function to address this problem by using the NZ() function
    Jerry

  3. #3
    Lounger
    Join Date
    Apr 2008
    Location
    Jacksonville, North Carolina, USA
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='jezza' post='793574' date='16-Sep-2009 19:59']Matt

    Could you change the query/function to address this problem by using the NZ() function[/quote]


    What is the NZ() function

  4. #4
    Lounger
    Join Date
    Apr 2008
    Location
    Jacksonville, North Carolina, USA
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='jezza' post='793574' date='16-Sep-2009 18:59']Matt

    Could you change the query/function to address this problem by using the NZ() function[/quote]


    No that didn't work I tried it Disregard the last post

  5. #5
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post
    [quote name='Bighale' post='793578' date='16-Sep-2009 20:08']No that didn't work I tried it Disregard the last post[/quote]


    That's a pity, can we see the syntax of the troublesome function/query please
    Jerry

  6. #6
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    [quote name='Bighale' post='793572' date='17-Sep-2009 06:54']I was wondering if there was a quick fix for the division by zero situation[/quote]

    The first step in solving the problem is to decide what you want to happen when the denominator is zero.
    Then include an IF statement to test for a zero in the denominator, and include your desired outcome.

    e.g. (air code) if([quantity]=0,0, [price]/[quantity])
    Regards
    John



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •