Results 1 to 6 of 6
  1. #1
    kwooten is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2011
    Posts
    255

    division by 0

    I have a % column that divides one column by another. For some the outcome is "#Error" due to the math #/0.. I have set a formula for if 0, then "0.0%" however doing this makes all the other calculations for that column a 10 digit long decimal... how can i fix this so i dont loose the % format of the other variables?

  2. #2
    RayMilhon is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,060
    What exactly is your formula and formatting for this column?

  3. #3
    kwooten is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2011
    Posts
    255
    the formula is a common division formula, the formatting is on percent

  4. #4
    RayMilhon is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,060
    Ok, maybe I wasn't clear. The column of the query you are asking about Is it??? IIF(divisor = 0,"0.0%",numerator/divisor) If that's not it what is it? If you right click on that column and look at the properties exactly what is there under format?

  5. #5
    kwooten is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2011
    Posts
    255
    yes my current query formula is now IIF(divisor = 0, "0.0", numerator/divisor)... it wont stay in the percent format though

  6. #6
    RayMilhon is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,060
    Ok, make the following change IIF(divisor=0,0,numerator/divisor)In the Formatting Make sure it's set to percent Then under decimal places It probably shows automatic change it to 1. that should do it.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Division by zero error on a query
    By thorwood in forum Access
    Replies: 3
    Last Post: 05-19-2011, 07:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums