Type Conversion Failure - importing text file

G

Guest

I hope somebody can help. I am importing a text file into access as a table. I am using the "import text wizard". I click on the advance button and I've set up the import specifications by field. For this particular import I have approx 30 fields that are money amount fields and they are defined in the text file as PIC S9(16)V99. When I define them in the import specifications, I define as Long Interger with a field length of 19. By doing it this way, I am able to pull in the whole number without decimals. This is fine because then I create a query where I take that field and divide by 100 to get the decimals. The problem I am having is that on this one particular import I get 1 import error (type conversion failure) for one record. The field that failed to convert = 2191896752. Records above and below it all converted correctly. I can not figure out why only this one record failed to convert for this field. The only thing I can see is that this record has the longest amount of all the records. Does anybody have any idea's or thoughts?
 
P

Pieter Wijnen

simple
max long int is 2147483648 (if there'd only been an unsigned long int ....)
so your number is "to big" before it's divided ...

hth

Pieter

Sunriziz said:
I hope somebody can help. I am importing a text file into access as a
table. I am using the "import text wizard". I click on the advance button
and I've set up the import specifications by field. For this particular
import I have approx 30 fields that are money amount fields and they are
defined in the text file as PIC S9(16)V99. When I define them in the import
specifications, I define as Long Interger with a field length of 19. By
doing it this way, I am able to pull in the whole number without decimals.
This is fine because then I create a query where I take that field and
divide by 100 to get the decimals. The problem I am having is that on this
one particular import I get 1 import error (type conversion failure) for one
record. The field that failed to convert = 2191896752. Records above and
below it all converted correctly. I can not figure out why only this one
record failed to convert for this field. The only thing I can see is that
this record has the longest amount of all the records. Does anybody have any
idea's or thoughts?
 

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

Top