when I use TransferText from Access table to .txt file, data format is changed (1 Viewer)

lhanes72

Registered User.
Local time
Today, 03:13
Joined
Dec 2, 2008
Messages
31
Although the table I am exporting to a .txt file has all fields set up as text data types, when it pulls into the .txt file it adds a ".0" to the end of the cield. Does something in the Export specs need to change, because nothing I nothing I have changed on it seems to help. :confused:
 

boblarson

Smeghead
Local time
Today, 01:13
Joined
Jan 12, 2001
Messages
32,059
Try exporting a query instead of the table and format the field, in the query, the way you want it to come out.
 

lhanes72

Registered User.
Local time
Today, 03:13
Joined
Dec 2, 2008
Messages
31
I've tried using a query; but I must be using the wrong verbage. What I have is 7 sometimes 8 numeric text characters in a field 9 characters long. What it's doing is taking 1202011 and making it 1202011.0. I've tried using Format([Field], "General Number") but that doesn't fix it because I thought general numbers do not require the decimal like a fixed or standard number does. What should I use?
 

boblarson

Smeghead
Local time
Today, 01:13
Joined
Jan 12, 2001
Messages
32,059
Try this:

Format([Field],"##0000000")

The ## means optional so if you don't have them it won't include them and the 0 is necessary so if you had a number of 1201 it would bring back 0001201. But it should leave off the decimal.
 

lhanes72

Registered User.
Local time
Today, 03:13
Joined
Dec 2, 2008
Messages
31
When I tab out of the field in the query, the "##" disappear.

The CLng conversion didn't work either.
 

boblarson

Smeghead
Local time
Today, 01:13
Joined
Jan 12, 2001
Messages
32,059
What's the datatype in the table set to? And what is the decimal places in the table set to?
 

lhanes72

Registered User.
Local time
Today, 03:13
Joined
Dec 2, 2008
Messages
31
The datatype is set to Text. There is no property for decimals.
 

boblarson

Smeghead
Local time
Today, 01:13
Joined
Jan 12, 2001
Messages
32,059
Why are you storing it as text if it is a number? Why not store it as Long Integer?
 

lhanes72

Registered User.
Local time
Today, 03:13
Joined
Dec 2, 2008
Messages
31
Was able to figure out what was causing the problem to occur. The primary table resided on a database that only I use. It was being imported to a local database. The specs were created in my database. When we created the specs in the local database, the export worked when I used the "##0000000" format technique. Thanks very much for your help. That will be useful information in the future as well, I'm sure.
 

Users who are viewing this thread

Top Bottom