Link to home
Start Free TrialLog in
Avatar of ShawnGray
ShawnGray

asked on

MS Access 03, TransferText, decimal places

Exporting a table with:
DoCmd.TransferText acExportDelim, , "WSPerformance", "w:\utility\WSPerformance.txt", True, ""

In the table, I have one number field which is carried out to four decimals.  
But when I export, only 2 decimal places is taken.
ie:
Table shows .1367
Export text file shows .13

Can more decimal places be specified in the export?
Avatar of PatHartman
PatHartman
Flag of United States of America image

Use the Format() function in the query (don't export the table)  you export to force the four decimal places.
Avatar of ShawnGray
ShawnGray

ASKER

Thanks for the reply Pat.
The query has the proper format (looks the way I intend).
Seems the export only takes two decimals which is a problem when dealing with a Percent format.
If Pat's suggestion doesn't work you may be able to create and use an Import/Export Specification. To do that, manually export the table using the ribbon methods and save the options, then use the Specification file you created in your TransferText call.

The two articles below might help. The first is for 2007, but it's relevant for any version of Access.

https://support.office.com/en-us/article/Save-the-details-of-an-import-or-export-operation-as-a-specification-6b94e183-2b10-4333-a31a-001fe75321b5

https://support.office.com/en-us/article/Run-a-saved-import-or-export-operation-6969E099-4573-40F0-A1E0-F3042BDDB640
ASKER CERTIFIED SOLUTION
Avatar of Gustav Brock
Gustav Brock
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you all for the input.  I had been playing with the Export Specifications but can't find anything that allows for number format/decimals.
I believe, unless I'm missing something, I'll use Gustav's suggestion and convert the number in the ccur.  Then fix it on the other app using the txt file.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The solution you accepted from Gus is what I told you to do.
Sorry Pat; I didn't fully follow your explanation.  The 2nd part of Gus' suggestion, CCur,  was closer to what I ended up using.  Actually ended up just multiplying the field x 100.  Certainly didn't mean to ignore you.