Results 1 to 4 of 4

Thread: Rounding Error In Access Report

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2000
    Location
    Lagos, Nigeria
    Posts
    50

    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.

  2. #2
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343

    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...)

    BOFH Now, BOFH Past, Information on duplicates

    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...

  3. #3

    Thread Starter
    Member
    Join Date
    Nov 2000
    Location
    Lagos, Nigeria
    Posts
    50

    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?

  4. #4
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343

    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.

    BOFH Now, BOFH Past, Information on duplicates

    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
  •  



Click Here to Expand Forum to Full Width