"DanG" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)
> Hi all
>
> I'm getting a weird anomaly when I use the summation function of
> Access. For example, when I sum the following numbers:
>
> 274.28
> 68.57
> 34.71
> 1022.4
> 25.38
> -1425.34
>
> I should get 0 (zero). Instead, I get 2.27373675443232E-13.
>
> If I change the 274.38 to 274.36, I should get -.02, but instead get
> -0.019999999. which is almost -.02. Makes me think of the old Intel
> processor errors.
>
> The data originally came from a Firebird database, which was being
> summed and printed on a Crystal report via ODBC. The value should
> have been zero, and apparently is really, really close to zero, but
> isn't quite. A zero prints, though I have zero-suppress on, and that
> was my clue. So even Crystal is not summing to exactly zero.
>
> That's when I imported (not linked) the data into Access 2003, and ran
> the summation there, confirming that the numbers are not summing
> correctly.
>
> Rounding to two decimals does not fix the error.
>
> So I question my math processor. I have a Compaq nx7000.
>
> Thoughts and suggestions are welcome.
What type of field are these numbers stored in? Floating point formats
are inherently imprecise. If your field type is Number/Single, you
might try changing it to Number/Double to get better precision, but it
will still be imprecise. Or, if your numbers will never have more than
four decimal places, you might try changing the field type -- not its
format -- to Currency.
--
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)