The information in this article applies to:
Moderate: Requires basic macro, coding, and interoperability skills. This article applies only to a Microsoft Access database (.mdb). SYMPTOMSWhen 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. CAUSEAccess stores date and time values for all date fields. When you export the data to a text file, 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 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. To do so, follow these steps
Method 2Access 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 10 characters in the Export specification. This truncates the time portion of the date field during export.NOTE: This method assumes you have the Four Digit Years and Leading Zeroes in Dates options checked in the Export Specification dialog box. NOTE: Most common text exports require the data to be delimited using the Text (Delimited) format. Method 2 is not useful in these cases. MORE INFORMATIONCAUTION: Following the steps in this example will modify the sample
database Northwind.mdb. You may want to back up the Northwind.mdb file
and perform these steps on a copy of the database.
Steps to Reproduce Behavior
REFERENCESFor more information about exporting data to other file formats, click Microsoft Access Help on the
Help menu, type "exporting data, data formats" in the Office Assistant or the Answer Wizard,
and then click Search to view the topics returned. Additional query words: prb
Keywords : kbusage kbdta IsmTxtd IsmTxtfx |
Last Reviewed: June 10, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |