|
-
Aug 12th, 2005, 03:25 AM
#1
Thread Starter
Member
Rounding Error In Access Report
Please I need help on how to eliminate rounding errors in Access report. I want the sum of values in Details to be exactly equal to the summation in the Footer.
e.g.
Name Contribution To-Date
David 45,000.00
Samuel 45,000.00
Smith 47,000.00
Tayewo 53,000.00
Subtotal 190,000.57
What I want is for the Subtotal to show 190,000.00
I used Sum(Abs([CntrTD])) to pull the values from a table.
Please help
Tayewo
I have actually posted this in Database section but no response yet.
-
Aug 12th, 2005, 03:47 AM
#2
Re: Rounding Error In Access Report
Are you formatting the data?
'Cause it looks like you have values after the decimal point, but it is reformatting it to a value without the decimal places (such as clng...)
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
Aug 12th, 2005, 06:59 AM
#3
Thread Starter
Member
Re: Rounding Error In Access Report
The decimal place is still there and it should still be there. The problems is this. If the annual basic salary of a staff is $10,000.00, the monthly salary will be 833.33 to 2 decimal places. Now if you have several staff with such amount, while Acccess report will display 833.33 against each staff in Details, it may approximate it to say $10,000.00 for 12 staff whereas casting 833.33 in 12 places will be 9,999.96 giving rise to a difference.
The question is how do I make sure that what is displayed in Report Details is the exact sum I have in Report Footer?
-
Aug 17th, 2005, 03:49 AM
#4
Re: Rounding Error In Access Report
If you limit to two decimal places and store that, then yes there is a problem with rounding.
However if you store the 833.33333333333333333333333333333333333 number that is calculated then there shouldn't be such a huge difference.
To display on forms etc, use the format command/function or method then the data will be more accurrate.
Example:
10,000 / 12 = 833.3333333333333333333 (etc)
Store this into the table (decimal or double value)
Then when you add them up it should be 10k again, or very close to. It probably depends on the type you store in the database.
The display on the form using format(#,#.00) would be 833.33 (that is what the user thinks it is).
Have a try and see what happens. If you still have a problem, post up.
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|