Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
OpenRowSet() and currency precision
Message
From
23/07/2021 14:26:37
 
 
To
23/07/2021 10:03:55
General information
Forum:
Microsoft SQL Server
Category:
Import/Export
Miscellaneous
Thread ID:
01681915
Message ID:
01681916
Views:
31
Michel,
AFAIK Excel does not use/store a currency data type, but uses only certain formating options to display numbers.
So multiplying by 10000 or even higher should move the decmal point far enough to the right for import -
database currency data format is meant to support large amounts with a bit of leeway in decimal places (8 byte, 4 decimal places).

To fit into decimal data type and "mindset" you should analyze how you reached the 5 decimal places - always keeping in mind to divide at last minute as you'd need to do with the import "trick" is a band-aided crutch and should be eliminated ASAP.

my 0.22€ (in either DB format...)
thomas

>We use OpenRowSet() to import Excel data. We discovered that if a field in Excel is formatted as currency that the import is maxed out at 4 decimals. We have values such as 0.13777. They are shown in Excel as 0.13$. They are imported at 0.1308. This creates an offset of 0.01$ in our total when we multiply that with a quantity as it is actually not the same value we have in our database. As anyone found a way to have the import respect the number of decimals in Excel or to simply import the real value when the field is formatted as currency?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform