Previous Topic Next topic Print topic


CHAR

ANSI DB2 SQL/DS XDB
  X   X

Transforms date, time or timestamp value into a character string. The format appears below:

CHAR([x [, format]])

If present, x must evaluate to a date, time or timestamp value. If x is null, the result is null. The parameter format is a string format for date or time, as shown in the table below. If omitted, the system default format is used. The format parameter cannot be specified if x is a timestamp.

Format Name Date Format Time Format
ISO International Standards Organization Standard yyyy-mm-dd hh.mm.ss
USA IBM USA Standard mm/dd/yyyy hh:mm AM or PM
EUR IBM European Standard dd.mm.yyyy hh.mm.ss
JIS Japanese Industrial Standard Christian Era yyyy-mm-dd hh.mm.ss
LOCAL Configured through the Options Utility. User Defined User Defined

Examples are:

CHAR(birth_date, USA)
CHAR(airtime, ISO)
CHAR(auditstamp)
Previous Topic Next topic Print topic