181.72 - 181.00 = 0.719999999999999
Why does Access do this? How can I get the correct answer of 0.72
181.72 - 181.00 = 0.719999999999999
Why does Access do this? How can I get the correct answer of 0.72
Always use Currency as data type (also for your table fields) for amounts and quantities that require no more than four decimals:
Result = CCur(181.72) - CCur(181.00)
Result -> 0.72
For more decimals, use Decimal:
Result = CDec(181.59898) - CDec(181.00)
Result -> 0.59898
For use in a query, CDec will fail, so write a function to call it:
Public Function CVDec(ByVal Value As Variant) As Variant
Dim Result As Variant
Result = CDec(Value)
CVDec = Result
End Function