By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,776 Members | 1,302 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,776 IT Pros & Developers. It's quick & easy.

Variance Query

P: 4
Hi can anyone help me with this?

I've got a field in a query to calculate the weight charge:

CalcWeightCharge: [weight]*[RatePerKg]

Then in another field i would like to calculate the variance from the given charge to the calculated weight charge, so i have used:

WeighChargeVar: [WeightCharge]-[CalcWeightCharge]

When i run the query i get some variance even though there isnít any. I get some of the following variances:

5.6843418860808E-14
1.13686837721616E-13
2.8421709430404E-14

Can someone please explain why i am getting these when there is no variance?

The variance appears on some only not all..

Thanks
Jan 31 '08 #1
Share this Question
Share on Google+
3 Replies


Delerna
Expert 100+
P: 1,134
These are extremely small values
eg 5.6843418860808E-14
is 0.0000000000000056843418860808

This suggests to me that the variance is due to rounding differenses
Jan 31 '08 #2

P: 4
Thanks,

Is there a way were i can have it display 0 rather than these small values?



These are extremely small values
eg 5.6843418860808E-14
is 0.0000000000000056843418860808

This suggests to me that the variance is due to rounding differenses
Feb 1 '08 #3

Delerna
Expert 100+
P: 1,134
if the variance is only ever going to be whole numbers then you could use

int(value) to drop the decimals altogether
cint(value) rounds value to the nearest integer


otherwise
round(value,numdecimals)

check the help files as i'm going off memory here
and my memory is notoriously bad
Feb 1 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.