rounding

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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,
 
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
 

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

Back
Top