A
Alan Englefield
Hello there,
I have inherited a DB with several fields that have the date stored as
text in the format "dd.mm.yy".
When I change the field type to Date/Time, access throws a hissy fit
saying that it will delete all of the record entires for these fields.
Is there a way that I can do a one-off conversion of all of the data
in the table either separately or field-by-field?
I got the following code from a newsgroup but I don't know how to
implement it as it is a function;
I can link it to a button on a form so that it runs, but I don't know
how to reference the fields that I need to change:
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
Any help would be appreciated and step-by-step help would be
worshipped
Thanks,
Alan
I have inherited a DB with several fields that have the date stored as
text in the format "dd.mm.yy".
When I change the field type to Date/Time, access throws a hissy fit
saying that it will delete all of the record entires for these fields.
Is there a way that I can do a one-off conversion of all of the data
in the table either separately or field-by-field?
I got the following code from a newsgroup but I don't know how to
implement it as it is a function;
I can link it to a button on a form so that it runs, but I don't know
how to reference the fields that I need to change:
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
Any help would be appreciated and step-by-step help would be
worshipped
Thanks,
Alan