Importing numbers from .txt with a comma

G

GD

I'm trying to import data from a .txt file, but numbers with a comma in them
are causing trouble.

- If I try to import the .txt file, using Long Integer as a type, I get
import errors for those fields with a comma.

- If I try to append to a table (using Number type) via a link (using Long
Integer type), I get the dreaded "Numeric field overflow" message.

How can I fix this? It doesn't matter to me whether the final result in
these fields have the comma or not. I just need them to import properly, and
I need to be able to perform calculations once they are in the table.

THANKS!!!!
 
K

KARL DEWEY

What about using double instead of integer and CDbl([ImportData]) to convert
text?
 
J

John W. Vinson

I'm trying to import data from a .txt file, but numbers with a comma in them
are causing trouble.
- If I try to import the .txt file, using Long Integer as a type, I get
import errors for those fields with a comma.

Is the comma a decimal separator (European style, e.g. 350,25 is three
hundred fifty and a quarter)? If so, Long Integer is the wrong datatype: an
Integer is by definition a whole number.
- If I try to append to a table (using Number type) via a link (using Long
Integer type), I get the dreaded "Numeric field overflow" message.

How can I fix this? It doesn't matter to me whether the final result in
these fields have the comma or not. I just need them to import properly, and
I need to be able to perform calculations once they are in the table.

THANKS!!!!

I suspect you just want to use a Currency datatype rather than Number (if four
digits after the decimal is enough), or a Double if not.

Perhaps you could post an example of the data and the desired result.
 

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