Information générale
Forum:
Microsoft SQL Server
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?
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement