Converts a character expression to a date expression.
CTOD(cExpression)
Specifies a character expression.
Date data type. CTOD( ) returns a Date value.
CTOD() can create ambiguous Date values and generates a compilation error when SET STRICTDATE is set to 2. To create unambiguous Date values, use the DATE( ) function.
The following example uses CTOD( ) to convert Character data to a Date and then performs simple date related actions.
SET CENTURY ON && Shows the century value. cDate="01/01/2003" ?CTOD(cDate) && Returns 01/01/2003 as Date. ?GOMONTH(CTOD(cDate),12) && Returns 01/01/2004. ?CTOD(cDate)+100 && Returns 04/11/2003.