Date format in query export.


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".

Anyone know what I am doing wrong?

Thanks.
 
Ad

Advertisements

D

Duane Hookom

Are you certain the field is a date field and not text?

Duane Hookom
MS Access MVP
 
H

Hansplay

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

Thanks

Duane Hookom said:
Are you certain the field is a date field and not text?

Duane Hookom
MS Access MVP

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".

Anyone know what I am doing wrong?

Thanks.
 
J

John W. Vinson

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".

Anyone know what I am doing wrong?

Thanks.

Access ignores the format property of a field in the export. Are you certain
that you're exporting the text string generated by the Format() function call?
or perhaps the export is exporting the actual date/time field? Perhaps you
could post the SQL of the query that you're exporting.
 
Ad

Advertisements

H

Hansplay

John, here is the SQL of the query.

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]));

Thanks.

John W. Vinson 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".

Anyone know what I am doing wrong?

Thanks.

Access ignores the format property of a field in the export. Are you certain
that you're exporting the text string generated by the Format() function call?
or perhaps the export is exporting the actual date/time field? Perhaps you
could post the SQL of the query that you're exporting.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top