Re: ARGH! Access can't add up?!?
From: Pecanfan (pecanfan_at_no.spam)
Date: 03/18/05
- Next message: Nicola Jones: "Re: Dynamic forms"
- Previous message: Nicola Jones: "Re: Dynamic forms"
- In reply to: Tom Lake: "Re: ARGH! Access can't add up?!?"
- Next in thread: Van T. Dinh: "Re: ARGH! Access can't add up?!?"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 18 Mar 2005 12:48:14 -0000
> > =Int(([InvoiceTotalNET]*(([cbxVATRate].[Column](0))/100))*100)/100
> >
> > Now, you'd expect when InvoiceTotalNET = 108 and cbxVATRate = 17.5 that
> > the
> > above would come out as 126.90 but NO - for some reason it's coming out
at
> > 126.89!!! Same happens for 10800 (this comes out at 12689.99) BUT 1080
> > comes out at the correct value, 1269.00. What the... ?!?!
>
> Are you sure your formula's right? I get 18.9 when I do the above. To
get
> your figure, I have to do this:
Are you sure? That's copied and pasted straight out the form.
> =[InvoiceTotalNET] + [InvoiceTotalNET] * [cbxVATRate].[Column](0)] / 100
>
> The error you're seeing is called floating point error. Most versions of
> BASIC (including VBA) use floating point numbers to represent data and
> there's some rounding error.
Bugger. Cheers! :-)
Andy
- Next message: Nicola Jones: "Re: Dynamic forms"
- Previous message: Nicola Jones: "Re: Dynamic forms"
- In reply to: Tom Lake: "Re: ARGH! Access can't add up?!?"
- Next in thread: Van T. Dinh: "Re: ARGH! Access can't add up?!?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|