[AccessD] Rounding Error - A2K

Gustav Brock Gustav at cactus.dk
Wed Dec 9 12:54:35 CST 2009


Hi Reuben

Round in Access is known to be buggy.
If you are interested in rounding and how to optimise this regarding speed while still being accurate, read on here:

  http://www.xbeat.net/vbspeed/c_Round.htm 

Note that the absolutely simplest (but slowest) method to perform 100% correct (mathematical) rounding is ... Format!

/gustav


>>> accessd at gfconsultants.com 09-12-2009 19:39:40 >>>
Can anyone explain to me, given the following two sets of numbers why I get
the answers I do in Access?
I'll also provide the answers to the same numbers and equations in Excel.
Access simply seems to be rounding wrong.
And these are only 2 out of 22.  The other 20 are correct.

=============================================
.47
206104.58
118507.98
3312.20
16
4274.27
Total = 332215.50

% = .258099

If I do Round(Total*%,2) I get 85,744.48
In excel I get 85,744.49

The number, before rounding is 85744.48833

=============================================

The 2nd set is 
66986.81
29694.41
1837.46
Total = 98518.68

% = .253696

Round(Total*%,2) in Access gives me 24,993.79

Excel gives me 24,993.80

Before rounding it is 24993.79504
=============================================

Why the rounding errors?

Reuben Cummings
GFC, LLC
812.523.1017






More information about the AccessD mailing list