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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I export dates to a text file in CCYYMMDD format?

Status
Not open for further replies.

jmlbones

Technical User
Jul 16, 2001
13
US
I have table that needs to be exported to a text file. This table contains a few fields that contain date fields. For example, on record as a value of 01/02/00. I need to export this table to a text file where this value should be 20000102. Is there something I can do within the format of the table or can I export the table through a query with an expression that formats the date for me?
 
Make a new column in your query with the format function to display the date as you desire.

ConvertedDate: Format([MyDate],"YYYYMMDD") Joe Miller
joe.miller@flotech.net
 
Thanks for the info. I was able to use your suggestion to get the query to display the date in the format that I needed. However, now when I run the export from the query to the text file I receive an error stating that data was lost. I updated my import/export specification to reflect the converteddate field in the query. The export runs but now the date field is populated in the text file. Any ideas? Thanks, Jason
 
Not sure! Does the specification say that the field is a text field or a date field? This should be a text field now with the different formatting.

Joe Miller
joe.miller@flotech.net
 
That was it. The format for the field within the specification was not set to text. Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top