ACC: Exporting Date Fields to Text Includes Time FormatLast reviewed: June 3, 1997Article ID: Q103174 |
The information in this article applies to:
SYMPTOMSModerate: Requires basic macro, coding, and interoperability skills. When you export a table that includes a Date/Time field to a text file, Microsoft Access automatically adds the time format to the date in the exported text file. The Date/Time field appears in the text file in mm/dd/yy hh:nn:ss format.
CAUSEMicrosoft Access stores date and time values for all date fields. When you export the data to a text file, Microsoft Access exports both the date and the time. If there is no data for the time portion of a date, the time appears as 0:00:00, indicating 12 A.M.
RESOLUTIONThere are two methods you can use to work around this behavior.
Method 1Create a query with a calculated field to format the date field appropriately, and then export the results of the query. NOTE: This method does not work in Microsoft Access 1.x since you cannot export a query in those versions. Instead, use a Make Table query in step 2, and then export the new table.
Method 2Microsoft Access can create a fixed width text file, using the "Text (Fixed Width)" export format. Using this method, you can set the size of the date field to 8 characters in the Export specification. This truncates the time portion of the date field during export. NOTE: Most common text exports require the data to be delimited using the Text (Delimited) format. Method 2 is not useful in these cases.
STATUSThis behavior is by design.
MORE INFORMATION
Steps to Reproduce Behavior
REFERENCESFor more information about exporting data to other file formats, search the Help Index for "exporting data, data formats," or ask the Microsoft Access 97 Office Assistant. |
Keywords : IsmTxtd IsmTxtfx kbusage
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |