Microsoft KB Archive/153364

= ACC: Exporting to Text file Truncates to Two decimals Places =

Article ID: 153364

Article Last Modified on 1/19/2007

-

APPLIES TO


 * Microsoft Access 95 Standard Edition
 * Microsoft Access 97 Standard Edition

-



This article was previously published under Q153364



Novice: Requires knowledge of the user interface on single-user computers.



SYMPTOMS
If you have a table that contains a number field with more than 2 decimal places, and you export the table to a text file, the decimal places will be truncated to 2 positions.



RESOLUTION
To work around this behavior, instead of exporting the table, 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([fieldname],"##0.0000")



STATUS
This behavior is by design.



Steps to Reproduce Behavior
 Open the sample database Northwind.mdb. Open the Suppliers table in Design View.  Add a field to the Suppliers table with the following properties:

     Field Name: Cost Data Type: Number Field Size: Double Decimal Places: 4  Close and save the table.</li> Open the Suppliers table in Datasheet view and scroll right until you see the Cost field. Type data into this field for several records, and make sure the data contains at least 3 decimal places.</li> Close the table, and on the File menu, click Save As/Export.</li> In the Save As dialog box, click "To an External File or Database," and then click OK.</li> In the Save As Type box, click Text Files, and then click Export.</li> When the Text Export Wizard appears, click Next twice, and then click Finish. When the file has been exported, open the text file. Note that the Cost field is truncated to two decimal places.</li></ol>

<div class="references_section">