netmergence
asked on
Microsoft Access 2007 Rounding Numbers Frustration
I have a database that performs simple accounting. The problem that I am running into is that it stores many decimal places even though it is only displaying 2. This is a problem because when I add many calculated fields together, frequently the fractions of a cent stored in the database add up to a cent, and the calculation is off by a cent!
To fix this, I am using the round([fldMoney]+0.000001, 2) function to round off to the nearest cent before doing the calculation and it seems to be working. If anyone has an easier suggestion let me know.
However, my real problem is this number: 480018.10
If I enter this number into a field that is set as a Single, Format Currency, 2 decimal places, it automatically changes it to 480018.09375 -- which gets rounded to 480018.09
I've tried it on several fields of my database and they all do it, so it isn't a bug on the one field, it's something to do with Access. Anyone know how to fix this?
To fix this, I am using the round([fldMoney]+0.000001,
However, my real problem is this number: 480018.10
If I enter this number into a field that is set as a Single, Format Currency, 2 decimal places, it automatically changes it to 480018.09375 -- which gets rounded to 480018.09
I've tried it on several fields of my database and they all do it, so it isn't a bug on the one field, it's something to do with Access. Anyone know how to fix this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Bingo! I had no idea...
Also, you can control your decimal places in the table definition once you select a field to use the currency data type.
Lee