Converts a datetime value to a character string of a specific format.
Syntax
DATE_TO_CHAR( datetime, io-format )
|
Example
DATE_TO_CHAR( start_date, 'MM/DD/YY' )
|
DATE_TO_CHAR is a convertible function resolved by USoft and thus supported on all RDBMS platforms. However, its exact behaviour partly depends on the underlying RDBMS function.
On Oracle, USoft converts the input expression to:
TO_CHAR( datetime, io-format )
|
|
On SQL Server, USoft converts the input expression to:
CONVERT( VARCHAR, datetime, io-format )
|
and this raises an error if io-format is not one of the standardised formats supported for this use of the SQL Server CONVERT() function. For example, the following will raise an error on SQL Server:
CONVERT( VARCHAR, start_date, 'DD-MON-YYYY' )
|
|
On ODBC, the function has no effect because USoft converts the input expression to:
|
On JDBC and Derby, USoft converts the input expression to:
TO_CHARDATE( datetime, NVL( io-format, 'DD-MON-YYYY' ) )
|
|
|