Decimal Places

K

Ken

Good Day:-

I have a challenge with decimal places. I'm reading a price which is 8
decimals from a sql database and trying to save that entire value into a
table. However it would only save to four decimals. I have defined the field
as number with 8 decimals.... The value saved is always 4. I even used the
formatcurrency and formatnumber function but no luck. For accuracy I need the
value saved to 8 decimals.

I'm currently using Access 2003.

Any thoughts on this?
 
J

John W. Vinson

Good Day:-

I have a challenge with decimal places. I'm reading a price which is 8
decimals from a sql database and trying to save that entire value into a
table. However it would only save to four decimals. I have defined the field
as number with 8 decimals.... The value saved is always 4. I even used the
formatcurrency and formatnumber function but no luck. For accuracy I need the
value saved to 8 decimals.

I'm currently using Access 2003.

Any thoughts on this?

Don't confuse the format, or even the specified number of decimals, with the
datatype. A Currency datatype has only four decimals.

For this purpose I'd suggest using a Decimal datatype, precision 18, scale 8.
A Double will also give you 8 (up to 14 actually) decimals but they'd be
variable and subject to roundoff error.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top