Results 1 to 4 of 4

Thread: [RESOLVED] ACCESS DB SUM() not summing correctly

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2004
    Location
    Bloomingdale, IL USA
    Posts
    284

    Resolved [RESOLVED] ACCESS DB SUM() not summing correctly

    I have an Access 2003 Database. I am trying to SUM a field and in a couple of instances, it is returning a strange number.

    For example, the database contains these numbers:

    124.25
    100.1
    200.5

    The sum should be 424.85 and it is returning something like 424.849999999998. I looked in the database and there are no strange numbers stored... they are all 2 decimal places. The following is the query I am using.

    SELECT SUM(amount) as xAmt, month FROM detail where year = '2011' AND ocode = '23130' GROUP BY month

    I attached the table with the query so you can see for yourself.

    Any suggestions are greatly appreciated!
    Attached Files Attached Files

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: ACCESS DB SUM() not summing correctly

    424.849999999998 is 424.85 rounded to two decimal places.

    The SUM is working properly. It simply needs to be formatted with the proper rounding.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2004
    Location
    Bloomingdale, IL USA
    Posts
    284

    Re: ACCESS DB SUM() not summing correctly

    you have to click on the cell.... is returning this number... 714.239999999991 instead of 714.24. There are no numbers in the database that are more than two decimals... it should not be returning anything past 2 decimals.

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2004
    Location
    Bloomingdale, IL USA
    Posts
    284

    Re: [RESOLVED] ACCESS DB SUM() not summing correctly

    It works if i change the field to Decimal instead of Double.

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