Tab-delimited *.txt file linking; text into numbers

P

patrick

Dear all
I am trying to link a tab-delimited *.txt file into access.
The data contains amounts such as

-1,560.87

Linking the data into a linked table works fine (fields formatted as text).
All the cyphers and pre-signs (plus/minus) are visible, however the string is
aligned to the left like text. However, I wish to use the numbers in
calculations, eg. would have to use them not as text but as Double.
I think the problem lies in the thousand-commas but I have no idea how to
get this left aligned string (the amount) interpreted as a double number data
type.
Many thanks for your help.
 
K

Klatuu

You can use the CDbl function to convert a string to a double:

x = CDbl("-1,560.87")
 

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