Converts string_expr to a DATE data type.
TO_DATE does not convert data to any of the other datetime data types. Do not use the TO_DATE function with a DATE value for string_expr. The first two digits of the returned DATE value can differ from the original string_expr depending on format_arg or the default date format.
Syntax
[TD_SYSFNLIB.] TO_BYTES ( string_expr, format_arg )
- TD_SYSFNLIB.
- Name of the database where the function is located.
- string_expr
-
A character expression.
If the conversion fails, TO_DATE returns an error.
- format_arg
-
A character argument.
format_arg is a data format specifying the format of string_expr.
If format_arg is omitted, the following default date format is used: YYYY-MM-DD
If format_arg is NULL, TO_DATE returns NULL.
If format_arg is not valid, an error is returned.