Help and Support

ACC2000: Importing Text File with Dates in DDMMMYY Format (Access 2000)

Article ID:208318
Last Review:July 15, 2004
Revision:1.1
This article was previously published under Q208318
Moderate: Requires basic macro, coding, and interoperability skills.

This article applies only to a Microsoft Access database (.mdb).

On This Page

SYMPTOMS

When you import a delimited text file that has a field that contains values in a Medium Date format (DDMMMYY), the data for that field is not imported and an import errors table is created.

Back to the top

CAUSE

Microsoft Access does not recognize the Medium Date format when importing dates from a delimited text file.

Back to the top

RESOLUTION

To import Medium Dates in a delimited text file into a new table, follow these steps:
1.On the File menu, point to Get External Data, and then click Import.
2.In the Import dialog box, click Text Files in the Files of type box.
3.Find the text file that you want to import, select it, and then click Import to start the Import Text Wizard.
4.On the first screen of the wizard, click Delimited, and then click Next.
5.On the What delimiter separates your fields? screen, select a Delimiter and Text Qualifier depending on the format of the text file that you are importing. If the first line in the text file contains field names, check the First Row Contains Field Names check box. Click Next.
6.On the Where would you like to store your data? screen, click In a New Table, and then click Next.
7.On the You can specify information about each of the fields you are importing screen, click the column heading of the column that contains the dates to select that column. In the Data Type list, select Text. Click Next.
8.On the Microsoft Access recommends that you define a primary key screen, click the appropriate option: Let Access add Primary Key, Choose my own Primary Key, or No Primary Key." Click Finish. The wizard creates your table with a text field containing the dates in Medium Date format.
9.Open the new table in Design view and change the following properties of the Medium Date field:
   Data Type: Date/Time
   Format: Medium Date
					
When you save the table and close it, the text values are converted to dates.
You can use the preceding steps to import a delimited text file and append it to an existing table. In step 6, click the option In an Existing Table instead of In a New Table, and make sure the existing table's date field is a Text data type. After you import the data, change the field's data type to Date/Time and set its Format property to Medium Date.

Back to the top

MORE INFORMATION

Steps to Reproduce Behavior

1.Open any text editor, such as Notepad.
2.Type the following four lines of delimited text:
   DDMMMYY,MMDDYY
   01-Dec-98,12/1/98
   31-Jan-99,1/31/99
   15-Mar-98,3/15/98
					
3.Save the file as TestDate.txt.
4.Start Microsoft Access and open any database.
5.On the File menu, point to Get External Data, and then click Import.
6.In the Import dialog box, click Text Files in the Files of type box.
7.Locate TestDate.txt, and then click Import to start the Import Text Wizard.
8.On the first screen of the wizard, click Delimited, and then click Next.
9.On the second screen of the wizard, click to select the First Row Contains Field Names check box, and then click Finish. Note that you receive a message that some of the data (the dates in Medium Date format) were not imported successfully.

Back to the top

REFERENCES

For more information about changing a field's data type, click Microsoft Access Help on the Help menu, type change a field's data type in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

For more information about formatting dates, click Microsoft Access Help on the Help menu, type format property - date/time data type in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

Back to the top


APPLIES TO
Microsoft Access 2000 Standard Edition

Back to the top

Keywords: 
kbinterop kbprb KB208318

Back to the top

Article Translations

 

Related Support Centers

Other Support Options

  • Need More Help?
    Contact a Support professional by Email, Online or Phone.
  • Customer Service
    For non-technical assistance with product purchases, subscriptions, online services, events, training courses, corporate sales, piracy issues, and more.
  • Newsgroups
    Pose a question to other users. Discussion groups and Forums about specific Microsoft products, technologies, and services.