Date Format in an exported Delimited Text File

  • Thread starter Thread starter wallybrewser
  • Start date Start date
W

wallybrewser

Guest
When running a macro I made (probably wrong) to export a delimited text file (.csv), the date comes out with the following format dd/mm/yy 0:00. The problem is that I don't want the 0:00 at the end of the date, I only want a Short Date format. For some reason, Access adds 0:00 to the end of every date in each record.

Does anyone know how to get the date output to give me the Short Date ONLY and leave off the 0:00. I have formated the fields different ways, tried an input mask, etc with no luck...

Any help would be very much appreciated.

Thanks,
Rick
 
Once you've got all the data into the table you can make an update query that can convert the date field to the date part only using the DateValue() function.
 
The data in the table is formatted coorect. Running a querry is not a problem.

The macro basically just runs a querry and exports it as a text file. If I run the query directly, it outputs the date formatted just fine. I am sure that the data is input into the table in the dd/mm/yy format, but when I use the macro to export a text file it adds the "0:00" to the end.

Is there no way to just get the date formatted correctly in the output.. Is there an action I can add to the macro that would keep the date format the same... or???

It just seems like I am missing something simple...

Thanks again.
Rick
 
Sorry, I never realised that you were exporting and not importing (need new eyes, you see :rolleyes: ).

Is it a table you are exporting with a date/time field that includes both a date and a time?
 
No. The date field in the table ONLY includes the date and is entered like 05/15/03 for example. I have a querry that creates a table which includes the date field and the format of the date in the created table is GOOD.

I made a button on a form that runs a macro to export the querried table in a text format.

Here are the specifics of the macro:
I used the "Transfer Text" only action. Arguments: I chose "Export Delimited" as the Transfer Type, Specification Name is left blank, the querry name is in the "Table Name" box, the output File Name is in the "File Name" box, I entered "No" in the "Has Field Names" box and the last 2 boxes, "HTML Table Name" and "Code Page" are left blank.

Everything works great, except the exported .csv file has the "time" added onto the end of the date...
 
I'm having the exact same issue with "short date" correct in the table, but the 0:00 added in the csv file.
Does anyone have a clue how to resolve this?

Thanks,
Sup
 
Try this,

Form a query on the table selecting all the fields. Use the format function on the date field in the query.(i.e. Format([Field1],'dd/mm/yy') where Field1 is your date column name. Export this query instead of table with the help of TransferText method

Hope this helps...
 

Users who are viewing this thread

Back
Top Bottom