CTOD()

Advantage Concepts

Advantage Expression Engine function that converts a date string to a date value

Syntax

CTOD(<cDate>) à dDate

Parameters

<cDate>

A character string consisting of numbers representing the month, day, and year separated by any character other than a number. The month, day, and year digits must be specified in accordance with the function to set the date format.

Return Values

CTOD() returns a date value. If <cDate> is not a valid date, CTOD() returns an empty date.

Remarks

CTOD() is a character conversion function that converts a character string to a date. CTOD() is used whenever you need a literal date value. Some examples include:

CTOD() is the inverse of DTOC() which converts a date value to a character string in the format specified by the function to set the date format. DTOS() also converts a date value to a character string in the form yyyymmdd.

Note Advantage Expression Engine functions can be used in expressions such as record filter expressions and index expressions. They are not necessarily scalars supported within SQL statements. For a list of supported SQL scalar functions, see Supported Scalar Functions.

Note Memo, binary, and image fields are not supported in this Advantage Expression Engine function. If memo, binary, or image fields are used with this expression engine function, the Advantage Expression Engine will be unable to evaluate the expression.

See Also

DATE()

DTOC()

DTOS()

CTOT()

CTOTS()

STOD()

STOTS()

TSTOD()

Advantage TDataSet Descendant

AdsSetDate

TAdsSettings.DateFormat

Advantage Client Engine API

AdsSetDateFormat

AdsSetEpoch