PC Review


Reply
Thread Tools Rate Thread

Date Format Incorrect on Export

 
 
Hansplay
Guest
Posts: n/a
 
      11th Feb 2010
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

 
Reply With Quote
 
 
 
 
Rick Brandt
Guest
Posts: n/a
 
      11th Feb 2010
Hansplay wrote:

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

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Date Format incorrect mralmackay@aol.com Microsoft Excel Misc 0 29th Mar 2007 06:16 PM
Date Format Incorrect jack-e Microsoft ASP .NET 2 10th Oct 2006 12:02 AM
day/month/year in incorrect format for date format =?Utf-8?B?TSZBX0phY2s=?= Microsoft Excel Worksheet Functions 2 16th Aug 2005 08:15 PM
Incorrect date format Ric Microsoft Excel Programming 4 15th Jul 2004 11:34 AM
date format incorrect Dominique Vandensteen Microsoft ASP .NET 1 24th Oct 2003 03:24 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:15 PM.