Importing text with commas

S

steeler86

I am importing a tab delimited file that has some number fields with commas.
Nothing gets imported. How can I get them to import without removing all the
commas first.
 
J

John Nurick

One way is
1) import them to text fields
2) add a numeric field for each of the fields in question
3) use an expression like this in an update query to put the numbers
into the numeric fields:
CLng(Replace([FieldWithCommas], ",", ""))
If the numeric field subtype is other than Long, use the appopriate
conversion function, e.g. CDbl().
4) Delete the now-superfluous text fields.

But you may find it less trouble to remove the commas first, e.g. by
using the find-and-replace feature in Word or a text editor.
 

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