Query calculation

debbiedoobie10

Registered User.
Local time
Today, 10:04
Joined
Oct 1, 2010
Messages
13
I need some help with calculations.

I have a table field one is $257,481.48 (double, standard, 2) and field two is .000429 (single, standard, 6).

When I use a query to calculate $257,481.48 multiplied by .000429 the result is 110.50. The correct amount is 110.46.

Do you have any suggestions on how to fix this?

Thank you Debbie
 
Tested this and I get 110.459556719447.
 
This doesn't make a lot of sense because the number of significant digits involved in your description is more than enough to retain 5 digits for a simple two-factor, one-step multiplication. Is there a function or some other element you aren't showing us?

A SINGLE dedicates enough bits to guarantee 6 digits and you only have 3. A DOUBLE gives you 14 and sometimes 15 digits but you have only 8 digits. The rules for expression promotion SHOULD apply such that the SINGLE gets internally and temporarily promoted to a DOUBLE to finish the computation. The result SHOULD stay as a DOUBLE since that was the largest data type in the mix.

Do you have some sort of filtration or formatting rules on that particular field in the query? Or is the query feeding something that is somehow a scaled integer or some other unusual format?

June7 took the pragmatic approach and just tried it. I look at it from the data capacity viewpoint. Neither of us can explain it. I've got no clue UNLESS you have used something to round the result.
 

Users who are viewing this thread

Back
Top Bottom