I\'m trying to convert a text field into a date using CDate() in a recordset but keep getting a type mismatch error. The input text format is MMDDYYYY. Does CDate not recogn
The help for CDate says:
CDate recognizes date formats according to the locale setting of your system. The correct order of day, month, and year may not be determined if it is provided in a format other than one of the recognized date settings.
To avoid potential confusion due to locale settings, you might use DateSerial instead of CDate, as in expression like this (assuming Text Date always has 8 characters in MMDDYYYY format):
DateSerial(Right(rst![Text Date], 4), Left(rst![Text Date], 2), Mid(rst![Text Date], 3, 2))