Re: Summing query?



Thanks jerry fixed the problem using Decimals3
Tony
"Jerry Whittle" <JerryWhittle@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:F3040075-952F-4A61-A991-EB4E65F1A62C@xxxxxxxxxxxxxxxx
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" wrote:

Jerry how do I then limit it to 0 decimal places?
Tony

"Jerry Whittle" <JerryWhittle@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:56204946-22CE-427C-ABA9-CF30C0E9DEB0@xxxxxxxxxxxxxxxx
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.

"Tony Williams" wrote:

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


.