Convert date format when importing?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to import a comma delimited text file into an existing Access table.
The dates in the text file are in YYYYMMDD format and I want to convert them
to date/time format during the import. Is this possible? I'm doing this via
VBA code, I'm not using the Access menus.

Also, is there any way to edit an existing import spec via the Access menus?
I'm using Access 2000. Thanks.
 
I need to import a comma delimited text file into an existing Access table.
The dates in the text file are in YYYYMMDD format and I want to convert them
to date/time format during the import. Is this possible? I'm doing this via
VBA code, I'm not using the Access menus.

Not possible in a single step. The usual way is to temporarily link the
textfile, and then use an append query to move the data into the
existing table, with calculated queries to perform any type conversions
etc. For this date conversion, you'd use something like

sDate: DateSerial(CLng(Left([TheDate], 4)), CLng(Mid([TheDate],
5,2)), CLng(Right([TheDate],2)))
Also, is there any way to edit an existing import spec via the Access menus?
I'm using Access 2000. Thanks.

Start an import using the wizard, and then click the Advanced button to
get at the stored specs.
 
Back
Top