Examples
The following expression converts the dates in the DATE_PROMISED port to text in the format MON DD YYYY:
TO_CHAR( DATE_PROMISED, 'MON DD YYYY' )
If you omit the
format
argument, TO_CHAR returns a string in the date format specified in the mapping configuration, by default, MM/DD/YYYY HH24:MI:SS.US:
TO_CHAR( DATE_PROMISED )
| '04/01/1998 00:00:10.000000'
|
| '02/22/1998 13:31:10.000000'
|
| '10/24/1998 14:12:30.000000'
|
The following expressions return the day of the week for each date in a port:
TO_CHAR( DATE_PROMISED, 'D' )
TO_CHAR( DATE_PROMISED, 'DAY' )
The following expression returns the day of the month for each date in a port:
TO_CHAR( DATE_PROMISED, 'DD' )
The following expression returns the day of the year for each date in a port:
TO_CHAR( DATE_PROMISED, 'DDD' )
The following expressions return the hour of the day for each date in a port:
TO_CHAR( DATE_PROMISED, 'HH' )
TO_CHAR( DATE_PROMISED, 'HH12' )
TO_CHAR( DATE_PROMISED, 'HH24' )
The following expression converts date values to MJD values expressed as strings:
TO_CHAR( SHIP_DATE, 'J')
The following expression converts dates to strings in the format MM/DD/YY:
TO_CHAR( SHIP_DATE, 'MM/DD/RR')
You can also use the format string SSSSS in a TO_CHAR expression. For example, the following expression converts the dates in the SHIP_DATE port to strings representing the total seconds since midnight:
TO_CHAR( SHIP_DATE, 'SSSSS')
In TO_CHAR expressions, the YY format string produces the same results as the RR format string.
The following expression converts dates to strings in the format MM/DD/YY:
TO_CHAR( SHIP_DATE, 'MM/DD/YY')
The following expression returns the week of the month for each date in a port:
TO_CHAR( DATE_PROMISED, 'W' )
The following expression returns the week of the year for each date in a port:
TO_CHAR( DATE_PROMISED, 'WW' )