Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exporting decimals ? 1

Status
Not open for further replies.

pookie62

Technical User
Oct 22, 2004
139
GB
Hi,
Can someone help me ?
I use this
Code:
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8, "ExportScore", ExportFile
to export certain data to a csv file.
The data in the table has 14 decimals, but the csv contains only two decimals. I need at least three decimals..
How can I do that using the TransferSpreadsheet code ?

Fieldname = Tot_perc and is calculated from other data.
Fieldproperty is numeric

Thanks for helping me out !
 
No, I don't have an Exportspecification. I've played with that but couldn't get it done either that way.. (maybe my ignorance..)
Can't it be done with VBA ?
 


BTW,

Yare are NOT using a CSV transfer type: you selected Excel8 format.

Open the Excel file and FORMAT that column any NUMERIC way that you like.

Skip,

[glasses] [red]A palindrome gone wrong?[/red]
A man, a plan, a ROOT canal...
PULLEMALL![tongue]
 
Oops.. copied the wrong line..
This is the correct one.
Code:
 DoCmd.TransferText acExportDelim, , "ExportScore", ExportScore, -1
 
Check out "Regional and Language Options" in control panel. I think that "TransferText" gets its conversion rules there.
 
Tried it, but makes no difference... :-(
Any other ideas ?
 
I've hit this before...

My quick solution was to create a Query with numeric values defined with decimals via the FORMAT() Function. Worked fine for me. htwh,



Steve Medvid
"IT Consultant & Web Master"

Chester County, PA Residents
Please Show Your Support...
 
Create a Table (Field1 Text (10) and Field2 Number-Double)


Create a Query
SELECT Table1.Field1, Format([Field2],"#.######") AS Expr1, Table1.Field2
FROM Table1;

Export to Excel (CSV) or Text File
"TEST1","1.1234",1.12
"Test2","1.234567",1.23
"Test3","1.234568",1.23

Above Shows Format Field retaining decimals...

htwh,


Steve Medvid
"IT Consultant & Web Master"

Chester County, PA Residents
Please Show Your Support...
 
Create a Table (Field1 Text (10) and Field2 Number-Double)


Create a Query
SELECT Table1.Field1, Format([Field2],"#.######") AS Expr1, Table1.Field2
FROM Table1;

Export Query to Excel (CSV) or Text File
"TEST1","1.1234",1.12
"Test2","1.234567",1.23
"Test3","1.234568",1.23

Above Shows Format Field retaining decimals...

htwh,


Steve Medvid
"IT Consultant & Web Master"

Chester County, PA Residents
Please Show Your Support...
 
Thanks smedvid !
Gave you a star for being very helpfull !
Going to work this out..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top