Hi! This is a frequent problem with old database environments and appeared initially in the "x-base" family when people started to migrate dBaseII files (no "date" type) to dBase III.
Assuming the text string is 10 characters long and in the "dd/mm/yyyy" format all you would have to do (having previously SET DATE BRITISH) is REPLACE ALL datefield WITH CTOD(textfield)
If the text string has no slashes and no dashes, then it's more cumbersome ... you have to build the argument for the CTOD (characters to date) function piece by piece. Let's suppose the text string contains dates like "ddmmyyyy". Then you would REPLACE ALL datefield with CTOD(SUBSTR(textfield,1,2)+"/"+SUBSTR(textfield,3,2)+"/"+SUBSTR(textfield,5,4)).
If the format were "mmddyyyy" you would have to transpose the SUBSTRings a little bit.
Good luck!
QUOTE]Originally posted by dmly
Hi,
I have a DBF file with a text field containing date information. How can I convert the text field to date format automatically. I know I can use Access to convert it but it's time consuming. Anybody know any utility, please help??? [/QUOTE]