Share via

Cannot get database SUM to add correctly.

Anonymous
2012-03-05T22:02:20+00:00

I have Microsoft Office Database 2007. I cannot get the sum function to add correctly all the time. It will be a couple pennies out every so often and cannot figure out why. It does not add correctly when I have a number like 125.605. It will not round up. So I changed all the fields to 4 decimals. but it still won't add the third decimal.

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

4 answers

Sort by: Most helpful
  1. Anonymous
    2012-03-07T23:55:15+00:00

    Oh dear... sorry I don't use Works so I can offer no solution.  I did find this...

    http://support.microsoft.com/kb/76290

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2012-03-07T23:24:10+00:00

    OK CORRECTION I'm using Microsoft Works Database! Thought it was an office program.

    Apparently it will not accept any additional function like round etc.

    what my database function is:  weight * price = net

                                                    1250 * 0.6575 = $821.88

    When it goes to the report it has to add say 50 of these together. So it's the half and quarter cents throwing it out.

    My function is just =SUM(NET)

    It rounds properly when it is in the actual database. It just does not want to add the cents properly in the report.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2012-03-06T16:51:58+00:00

    Hmmm, have a look at...

    http://allenbrowne.com/round.html

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2012-03-05T22:53:19+00:00

    If you are using the Sum fubction in a Totals type query or in a form/report header/footer section, then the problem is probably because you are manually adding up the individual displayed values, which are rounded, and comparing that to the totalm which is not rounded until after the total is calculated.  In this case the total is the most accurate value and your manual calculation can be off by quite a bit.

    OTOH, if you are writing checks then the individual rounded values is what you write on the check and the total need to be a sum of the rounded values.  That means instead of using an expression like  =Sum(Amount)  you need to use  =Sum(Rnd(Amount, 2))

    If you are using Single or Double type number, but only need 4 decimal places, change to Curreny data type.

    If that diesn't help, post a Copy/Paste of how you are summing the field and provide more details about how the numbers are off.

    Was this answer helpful?

    0 comments No comments