I tried working with the data you provided and the import wizard.
One problem is that you do not have a date deliminater...
04JAN1993
vs
04/Jan/1993
or
04/01/1993
(Hint: Look at the "Advanced" tab when running the import wizard for more control of the import.)
04Jan1993 -> 11/4/993
20Jan2005 -> 12/20/2005
01Nov2003 -> error
So, I went on to Plan B.
I imported dates and times as text fields
The CDate(YourTime) worked perfectly in converting the time as a text to time as a date/time data type.
The date was more of a challenge.
I created an function to convert the date...
Code:
Function ConvertDate(MyDate As String) As Date
Dim intMonth As Integer, strMonth As String
strMonth = Mid(MyDate, 3, 3)
intMonth = (InStr(1, "JanFebMarAprMayJunJulAugSepOctNovDec", strMonth) / 3) + 1
ConvertDate = DateSerial(Right(MyDate, 4), intMonth, Left(MyDate, 2))
End Function
I did not include error checking, but the following SQL statement worked perfectly with the Text import file...
[tt]
SELECT T.MyID, T.MyDate, ConvertDate([MyDate]) AS My_Date, T.MyTime, CDate([MyTime]) AS My_Time, T.MyText
FROM TestTxt as T;
[/tt]
[tt]
MyID MyDate My_Date MyTime My_Time MyText
As Text As Date As Text As Date
1 04Jan1993 1/4/1993 9:30:30 9:30:30 AM Test1
2 05Jan1993 1/5/1993 9:45:31 9:45:31 AM Test2
3 06Jan1993 1/6/1993 10:00:32 10:00:32 AM Test3
4 07Jan1993 1/7/1993 10:15:33 10:15:33 AM Test4
5 08Jan1993 1/8/1993 10:30:34 10:30:34 AM Test5
6 01Feb1994 2/1/1994 8:00:00 8:00:00 AM Test6
7 01Mar1995 3/1/1995 9:00:00 9:00:00 AM Test7
8 01Apr1996 4/1/1996 10:00:00 10:00:00 AM test8
9 01May1997 5/1/1997 11:00:00 11:00:00 AM test9
10 01Jun1998 6/1/1998 12:00:00 12:00:00 PM test10
11 01Jul1999 7/1/1999 13:00:00 1:00:00 PM test11
12 01Aug2000 8/1/2000 14:00:00 2:00:00 PM test12
13 01Sep2001 9/1/2001 15:00:00 3:00:00 PM test13
14 01Oct2002 10/1/2002 16:00:00 4:00:00 PM test14
15 01Nov2003 11/1/2003 17:00:00 5:00:00 PM test15
16 01Dec2004 12/1/2004 18:00:00 6:00:00 PM test16
17 20Jan2005 1/20/2005 19:00:00 7:00:00 PM test17
18 25Feb2004 2/25/2004 19:00:00 7:00:00 PM test18
19 30Apr2003 4/30/2003 20:00:00 8:00:00 PM test19
20 15May2002 5/15/2002 21:00:00 9:00:00 PM test20
21 16Jun2001 6/16/2001 22:00:00 10:00:00 PM test21
22 22Jul2000 7/22/2000 23:00:00 11:00:00 PM test22
23 23Aug1999 8/23/1999 24:00:00 test23
24 24Sep1998 9/24/1998 01:00:00 1:00:00 AM test24
25 25Oct1997 10/25/1997 02:00:00 2:00:00 AM test25
26 26Nov1996 11/26/1996 03:00:00 3:00:00 AM test26
27 27Dec1995 12/27/1995 04:30:31 4:30:31 AM test27
28 12Apr1994 4/12/1994 05:45:00 5:45:00 AM test28
29 09May1995 5/9/1995 06:33:00 6:33:00 AM test29
30 21Sep1996 9/21/1996 07:55:21 7:55:21 AM test30
[/tt]
I included a wide range of samples to make sure it worked. The only issue is that CDate did not like 24:00:00.
To summerize...
- import as a text fields
- once the data is in Access, you can use CDate to convert the time
- use a function to convert the date.
After you are satisfied with the date and time conversion, you can change the SQL statement into an Append query to migrate the data into your final table.
Richard