Exporting Error To .csv File

paulS30berks

Registered User.
Local time
Today, 06:38
Joined
Jul 19, 2005
Messages
116
Wondered if someone could assist me.

I am exporting a query into a .csv file using the following:

Private Sub Output_To_CSV_File_Click()
On Error GoTo Err_export_Click
Dim AString As String
AString = "Export_Occupancy_"
DoCmd.TransferText acExportDelim, "", "ChildCare Vouchers For Accor", "\\uk.michaelpage.local\dfs\GroupData\NSCH\Elite Database Reports\ChildCare.csv" & AString & Format(date, "YYYY_MMDD") & Format(Time, "-HH_MM") & ".csv", True

Exit_export_Click:
Exit Sub
Err_export_Click:
MsgBox Err.Description
Resume Exit_export_Click
End Sub

This works fine, however the date format within my output file appears as:

13/05/1963 00:00:00

I wish this to be just 13/05/1963. I have formatted date etc. Is there something else I have overlooked?

Thanks
 
Have you checked the out put with a text eiditor to make sure the time element is really there? If so then try using the format function within the query rather than relying on the format property.

MyDate:Format([myDateField], "DD/MM/YYYY")

HTH

Peter
 
Thanks alot
 
I am trying to export to a .csv file too.

However I have a problem with the text fields. I need the result of the export to be all in upper case. The original data was entered in lower case. Is there a way to get it to do it automatically? Or does the data need re-entering?

I haven't programmed the export, but only use the File, Export menu.
 
use a query to format the data and export from the query.
You need to use the Format() function not formating from propeerties.

FirstName: Format([MyTable].[FirstName],">")

HTH

Peter
 

Users who are viewing this thread

Back
Top Bottom