Try OpenEdge Now
skip to main content
SQL Reference
SQL Reference : OpenEdge SQL Functions : TO_CHAR


Converts the given expression to character form and returns the result. The primary use for TO_CHAR is to format the output of date-time expressions through the format_string argument.


TO_CHAR ( expresion[ , format_string] )


Converts to character form. It must evaluate to a value of the date or time data type to use the format_string.
Specifies the format of the output. SQL ignores the format string if the expression argument does not evaluate to a date or time.


*The first argument to the function can be of any type.
*The second argument, if specified, must be of type CHARACTER.
*The result is of type CHARACTER.
*The format argument can be used only when the type of the first argument is DATE.
*If any of the argument expressions evaluates to NULL, the result is NULL.


Progress extension