I'd run an update query to convert the string field data into a date value and place the data in a new field defined as a date data type after the data is in the table as a string. CDate should do the trick except that it thinks mmddyyyy. It's generally smart enough to realize that:
23022001
means February 23, 2001, but
03022001
will be interpreted as March 2, 2001.
You can write a format conversion function and return the date datatype for your update:
Public Function StrToDate(strIn As String) As Variant
If Len(strIn & "") Then
StrToDate = cDate(Mid$(strIn, 3, 2) & "/" & _
Left$(strIn, 2) & "/" & Right$(strIn, 4))
Else
StrToDate = Null
End If
End Function
The function returns variants in order to handle nulls in case the field has no data.
Ciao
Jürgen Welz
Edmonton AB Canada
[email protected]