rounding

J

JMorrell

I have a field with data type of 'real' in my SQL Server linked table. In a
form, a user will enter a value of 6.66 in this field. When running a VB
process, Access looks at this number as 6.65999984741211. What data type do
I need to use to hold an actual value of 6.66?

It should be mentioned that my users will be doing calculations on these
numbers and that a precision of 2 decimal places is required.

tia,
 
J

John Vinson

I have a field with data type of 'real' in my SQL Server linked table. In a
form, a user will enter a value of 6.66 in this field. When running a VB
process, Access looks at this number as 6.65999984741211. What data type do
I need to use to hold an actual value of 6.66?

It should be mentioned that my users will be doing calculations on these
numbers and that a precision of 2 decimal places is required.

Use Currency as an Access datatype; if you want the data to stay in
SQL I'd suggest Decimal with two decimal places specified. Float is
stored as a binary fraction and will inevitably have this kind of
roundoff error.

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
Top