Question csv export adding decimal places

claris

New member
Local time
Today, 07:16
Joined
Nov 7, 2008
Messages
7
Hi people

I have a standard csv export which is adding decimal places to a field which needs to be standard.

I have tried all the normal ways of stopping this (setting the field format within the query and data build itself) and am now stuck as to what else to do. It seems it is ok when opened in Excel, but when opened with Notepad the decimals appear.

Here's my code:

DoCmd.TransferText acExportDelim, , "SALES_", "I:\Statistics\" & Year & Month & Day & "\SALES_" & Year & Month & Day & ".csv", -1


Not sure whether more detail is needed here...

Really appreciate your help.

Thanks
Claris
 
Try this:

Code:
sDate = Format(dtDate, "yyyymmdd")
sFileName = "I:\Statistics\" & sDate & "\SALES_" & sDate & ".csv"
DoCmd.TransferText acExportDelim, , "SALES_", sFileName, -1
Split into multiple statements for clarity. Supply your own dtDate.
 
Thanks WayPay but it's a field within the export which is 'growing' a decimal, not the format of the dates.
 
Have you tried
Code:
column_name: Int( [table_name].[column_name] )
as a query expression?
 
Grr..running out of ideas :mad:.

What is the format for the offending expression set to?
 
Tell me about it!
It's set to fixed, zero decimal places.
 
Now I'm really out of ideas. Can you post your database (or a relevant sample thereof)?
 
WHAT!?!? I tried CStr first and it didn't work!!! Now it has! How odd, perhaps changing the query column format and Cstr just bumped it.

Cheers guys - Mr Q - you rule

=]
 

Users who are viewing this thread

Back
Top Bottom