ACC: Exporting to Text file Truncates to Two decimals Places

Last reviewed: May 30, 1997
Article ID: Q153364
The information in this article applies to:
  • Microsoft Access versions 7.0, 97

SYMPTOMS

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

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.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Open the sample database Northwind.mdb.

  2. Open the Suppliers table in Design View.

  3. Add a field to the Suppliers table with the following properties:

          Field Name: Cost
          Data Type: Number
          Field Size: Double
          Decimal Places: 4
    

  4. Close and save the table.

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

  6. Close the table, and on the File menu, click Save As/Export.

  7. In the Save As dialog box, click "To an External File or Database," and then click OK.

  8. In the Save As Type box, click Text Files, and then click Export.

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

REFERENCES

For more information about exporting in Microsoft Access, search for "exporting data," and then "Export data to another database or file format," using the Microsoft Access 97 Help Index.


Additional query words: round rounding
Keywords : IsmTxtd kb3rdparty
Version : 7.0 97
Platform : WINDOWS
Hardware : X86
Issue type : kbprb
Resolution Type : kbworkaround


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: May 30, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.