Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exporting dates without the time 1

Status
Not open for further replies.

dhanus

Programmer
Jun 17, 2003
28
MY
Hi Experts

I am exporting data from a query to a text file.

My code is like this :

vFileName = "filename_" & Format(Date, "ddmmyy") & Format(Time, "hhnnss") & ".asc

DoCmd.TransferText acExportDelim, , "ExportDataToSAP", vFileName

My output file looks like this :

"PD",9/1/2004 :00:00,"s333","4006","1007",30000000.00,27.00,"s333"

"NT",27/1/2004 0:00:00,"S88888888888","4006","1007",30000000.00,27.00,"S88888888888"

How can I trim the date so that it appears as 9/1/2004
and not 9/1/2004 0:00:00 ??

The date format in my table is Short Date.

Dhanus
 
In the query use a calculated field instead of the original field.
EDate:format(MyDatefield,"dd/mm/yyyy")


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top