A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Importing numbers from .txt with a comma



 
 
Thread Tools Display Modes
  #1  
Old August 19th, 2009, 03:25 PM posted to microsoft.public.access.gettingstarted
gd
external usenet poster
 
Posts: 209
Default Importing numbers from .txt with a comma

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!!!!
--
GD
  #2  
Old August 19th, 2009, 03:40 PM posted to microsoft.public.access.gettingstarted
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default Importing numbers from .txt with a comma

What about using double instead of integer and CDbl([ImportData]) to convert
text?
--
Build a little, test a little.


"GD" wrote:

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!!!!
--
GD

  #3  
Old August 19th, 2009, 06:18 PM posted to microsoft.public.access.gettingstarted
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Importing numbers from .txt with a comma

On Wed, 19 Aug 2009 07:25:01 -0700, GD wrote:

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.
--

John W. Vinson [MVP]
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:50 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.