Date Format Incorrect on Export

  • Thread starter Thread starter Hansplay
  • Start date Start date
H

Hansplay

I am exporting a query to a .csv file. In a Date field I formatted as so:

FormattedActivityDate: Format([Activity Date],"yyyy/mm/dd")

The date in the .csv file shows up in the format, "m/dd/yyyy".

The data type in the table for this field is "Date/Time" and the format is
'Medium Date".

Here is the SQL for the query I am exporting:

SELECT tblLabourTransaction.[CWA Number],
tblLabourTransaction.[SubContractor ID], [My Company Contract #] & "-" &
Format([ReferenceNumber],"000000") AS ContractorReferenceNumber,
Format([Customer Employee ID],"00000") AS [Client Employee ID],
Format([ActivityDate],"yyyy/mm/dd") AS FormattedActivityDate,
tblLabourTransaction.AccountCode, tblLabourTransaction.[Reason Code],
tblLabourTransaction.Hours, tblLabourTransaction.[Work Order],
tblLabourTransaction.CraftCode, tblLabourTransaction.Schedule,
tblLabourTransaction.[Cost Center], tblLabourTransaction.Activity,
tblLabourTransaction.[Equipment ID], tblLabourTransaction.[End User Signoff],
tblLabourTransaction.[Activity Description]
FROM tblLabourTransaction
WHERE (((tblLabourTransaction.[Batch
Number])=[Forms]![frmExportMenu]![cmboBatchtoExportLab]));

Any ideas on how I can make the date format export properly?

Thanks
 
Hansplay said:
I am exporting a query to a .csv file. In a Date field I formatted as so:

FormattedActivityDate: Format([Activity Date],"yyyy/mm/dd")

The date in the .csv file shows up in the format, "m/dd/yyyy".

What are you opening the CSV file with to look at it? If you are using
Excel then it is Excel that is reformatting it. If you are using Notepad
then I fail to see why what you have now is not working.

Once you use the Format() function you have a string and there is no reason
for that to get changed to something else (unless the program you are
viewing it with does so).
 
Back
Top