1 Attachment(s)
[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!
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.
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.
Re: [RESOLVED] ACCESS DB SUM() not summing correctly
It works if i change the field to Decimal instead of Double.