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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CSV Export Number truncation problem 1

Status
Not open for further replies.

jamez05

Programmer
Jul 29, 2005
130
US
Hi, I have a query that I use to export data to an excel file (Access 2003):
Code:
DoCmd.TransferText acExportDelim, , "qryDelimited", strFile, True

The numeric fields (doubles) return values such as "1.07989595" From the query. However, when I export this to a .csv and open it up in Excel, it appears as
"1.07". Does anyone know how to fix this?
 
Export manually and specify the datatypes. Save the specification while you do it and note its name.

Use it as the second paramater for your Docmd.transfertext
 
Hello, one way to get around that is to convert the double into a string in your query - str(yourField).

Export out as a .csv and Excel will not drop digits when you open the file.

Hope that helps,

dRahme
 
I didn't connect to Excel... The data is likely in Excel, you just need to format the cells and / or widen the column to display the data.
 
Thanks for your replies

Will look into your feedback over the weekend.
 
HI,

I tried the str function and that somewhat worked. It changed the data correctly. However, you have to alias it, and I cannot use the same name as the alias without getting a circular reference error. These have to be named the same because its a template used for other programs as well.

I'm looking into exporting it manually. However, I haven't been able to find much info on this. Does anyone know of any good tutorials or have any info?

Thanks

James
 

Search for CopyFromRecodset method of the excel's Range object, so you could get a resultset from a query as please
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top