Date format in CSV export

From an Access database, I am exporting the result of a Query, as XLS (Excel) and also as a CSV file. The Excel dates come out correctly, e.g. "22/03/2011", but the CSV dates also give the time part  which I don't want, e.g. " 22/03/2011 00:00:00". I just want "22/03/2011" in the CSV as well. Any idea how I can fix this? Thanks.
DataTrainAsked:
Who is Participating?
 
telyni19Commented:
Try Format([DateField],"mm/dd/yyyy") for your query's date column definition. That should export the date as formatted text.
0
 
Rey Obrero (Capricorn1)Commented:
in your query, change the date column to

dateValue([dateField])
0
 
DataTrainAuthor Commented:
Thanks for the suggestion but that doesn't make any difference.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
Rey Obrero (Capricorn1)Commented:
how are you exporting the query as csv?
0
 
jerryb30Commented:
Actually, if you formatted the cells as date/time, they probably would also show the time part.
Please post your query SQL.
0
 
MeLindaJohnsonCommented:
I think you want format([datefield]. "dd/mm/yyyy")
0
 
MeLindaJohnsonCommented:
should be a comma after [datefield] in post before.
0
 
DataTrainAuthor Commented:
I don't believe the SQL is the issue as the date format it generates is correct and the XLS output is also correct. So I think it is something to do with the export to CSV. This is the command I am using: DoCmd.TransferText acExportDelim, , stqueryname, strSaveFileName
0
 
Rey Obrero (Capricorn1)Commented:
dataTrain, try the Format suggestion by telyni19, that should do it..
0
 
MeLindaJohnsonCommented:
If you want days, months, year then "dd/mm/yyyy".  If you want months, days, year then use "mm/dd/yyyy".  Your example shows days,month,year.

...copied from above....  I just want "22/03/2011" in the CSV as well.
0
 
Rey Obrero (Capricorn1)Commented:
FYI.
MeLindaJohnson,
you are basically repeating another experts earlier post at http:#a35191708
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.