Exporting to CSV text file - precision problem

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
 
D

David S via AccessMonster.com

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

John Vinson

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]
 

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