Exporting to CSV text file - precision problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I am trying to export an Access table to a CSV text file. I am using Access
2002. (The database was created in Access 2000.) I have several fields that
contain 8 decimal digits of precision when viewed from Access. However, only
2 of the 8 decimal places get exported to my text file.

When I try the export to Excel, all 8 decimal digits show up.

Is there a way to specifiy that all 8 decimal digits get exported to the CSV
text file?

Thanks,

Rochelle
 
When exporting to CSV files, the precision of the decimal digits is
determined by the Windows environment. You can either change it for Windows
overall by going to Start -> Settings -> Control Panel -> Regional and
Language Options -> Customise and change the "No. of digits after decimal"
field, or you can use a query to explicitly format this field eg. Format(
[FieldName], "0.0000000").

If you do it the second way, you may need to tell your csv export to not use
quotes to qualify text, of it will put quotes around them, which would make
things like Excel think it was text instead of being a number...
 
Is there a way to specifiy that all 8 decimal digits get exported to the CSV
text file?

Use the Format() function in a Query to explicitly cast the number
into an 8-decimal string:

ExpNum: Format([numberfield], "#.00000000")

John W. Vinson[MVP]
 
Back
Top