Exporting Delimited Text File Truncating

C

Craig

I am exporting a table from Access to Txt using a Macro
and the TranferText command - Delimited, however Number
fields which contain more than 2 decimal places are
truncated at 2 Decimals. Is there a setting which will
allow me to create the text file at a set number of
decimals eg 4 - using a specification for the export but
nothing is obvious. Help Please

Craig
 
J

Joe Fallon

Build a query and use Format function. Then export the query.

If your field is character based and needs to be right justified try:
Field: MyRightText: Right$(Space(10) & MyField,10)

If your field is numeric and needs leading zeroes use a similar technique to
return leading zeroes.
Field: MyRightText: Right$("0000000000" & MyField,10)

For decimal problems:
Create a query with the fields that you want to export and use the Format()
function to specify the number of decimal places in the number field. For
example, if your field has 4 decimal places, the column in the query grid
would look as follows:

Field: Format([MyField],"##0.0000")
 

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