Rounding problem

T

Tony Williams

Is there anyway to control the way Access deals with rounding?
I have 5 controls on a report, all are standard numeric with 0 decimal
places and the sum of 5 fields in my table. The underlying fields in the
table are however 3 decimal places. There is a total of the 5 controls on
the report as well. However this is an example of what I am getting;
Control1......Control2.......Control3.......Control4.......Control5........Total
22725 100 100 0.000 235
23161 (Should be 23160)
The underlying values in the field in the table are:
22725.102 100.000 100.000 0.000 235.40

Anyone any ideas? To someone looking at the report it would appear that I
can't add up!!!
Thanks
Tony
 
M

Marshall Barton

Tony said:
Is there anyway to control the way Access deals with rounding?
I have 5 controls on a report, all are standard numeric with 0 decimal
places and the sum of 5 fields in my table. The underlying fields in the
table are however 3 decimal places. There is a total of the 5 controls on
the report as well. However this is an example of what I am getting;
Control1......Control2.......Control3.......Control4.......Control5........Total
22725 100 100 0.000 235
23161 (Should be 23160)
The underlying values in the field in the table are:
22725.102 100.000 100.000 0.000 235.40

Anyone any ideas? To someone looking at the report it would appear that I
can't add up!!!


I believe I answered this question in another forum. Please
don't post the same question multiple times (multi post).
If you feel you need to post a question to multiple groups,
then post it once to both groups (cross post).
 
T

Tony Williams

Sorry Marsh but I haven't posted this question before, it must have been
someone else? Any idea which forum I could search to find the answer.
Thanks
Tony
 
M

Marshall Barton

My apologies Tony. I guess I wasn't all here when I posted
that, it was a similar but different question in the other
news group.

Let's discuss your values and their total. It's clear from
the underling values that the 23161 is more accurate than
the pencil and paper sum of the individual formatted
values. To alleviate the trauma of the **apparent**
discrepancy, how about displaying at least some of the
decimal places?

OTOH, if accuracy is not a critical issue, change the Total
text box to add up the rounded values using an expression
like:
=Round(field1,0) + Round(field2,0) +Round(field3,0) +
Round(field4,3) +Round(field5,0)

This way the total will use the same values that a person
would use. Just remember that, while the report will add
"correctly", the result will not be as accurate as it was
before.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top