I noticed that you actually wanted 3 decimal places in the first place so
'Fixed' wouldn't work there either. Back to the drawling board....
Decimals3: Format(Sum([field 1]+[field 2]), "0.000")
Decimals0: Format(Sum([field 1]+[field 2]), "0")
or
Decimals0: CLng(Sum([field 1]+[field 2]))
There might be a slight difference in the rounding between the two
Decimals0
above especially if you have any negative numbers.
--
Jerry Whittle
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.
Tony Williams said:
Jerry how do I then limit it to 0 decimal places?
Tony
Jerry Whittle said:
Format is how the data is displayed - not how it is stored. Change your
query to:
Format2: Format(Sum([field 1]+[field 2]), "Fixed")
It's also possible that there is a floating point math problem.
Debug.Print 3.1 - 3.11 doesn't give you what you expect. If you always
need just 2 decimal points, converting the field to currency might be a
solution.
--
Jerry Whittle
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.
:
I have a number of fields with a data format of Double, fixed 3
decimal
places. So why when I do run a query with say Sum([field 1]+[field 2])
do
I get an answer with 6 decimal places?
Intriguing?
Tony