Manish
Manish

Reputation: 213

Excel VBA to Access database: Decimal number issue

I am working on a small Access DB where I add row values as 1.1, 2.1, 3.1 from an Excel file. When I update, this is getting updated as 1.0999999999, 2.0999999999,3.1000000000000001 in the Access DB. If I want the value of 1.1 in Excel, it is not pulling from the Access DB due to decimal number change. I used "Text" as the data type in the Access DB. Is it because of the text data type or what should I choose to make the update as only 1.1, 2.1, etc.

Upvotes: 0

Views: 1430

Answers (2)

Manish
Manish

Reputation: 213

The issue resolved: I did following changed to the table and access SQL query.

I changed the data type to "Number" and Format to "Double". This is working as I expected. thanks!

Upvotes: 0

user5844160
user5844160

Reputation:

Round ( expression, [decimal_places] )

This will make it one decimal place.

Round(PassedVar, 1)

Upvotes: 1

Related Questions