Limited support BMC provides limited support for this version of the product. As a result, BMC no longer accepts comments in this space. If you encounter problems with the product version or the space, contact BMC Support.BMC recommends upgrading to the latest version of the product. To see documentation for that version, see BMC AMI Command Center for Db2 13.2

DATE function


The DATE function returns an internal representation of one of the following date data types:

  • DATE
  • TIMESTAMP
  • TIMESTAMP WITH TIMEZONE
  • CHAR
  • INTEGER

DATE.png

stringExpression

stringExpression must be a valid string representation of a date or timestamp with or without a timezone. If the encoding of the character string is not EBCDIC, the character string is cast to an EBCDIC CCSID(37) before conversion takes place.

integerExpression

integerExpression must be a positive integer not exceeding 3652059. This value represents the number of days since Jan 1,0001 plus 1.

dateExpression

The result is the date returned by the expression.

timestampExpression

The result is the date part of the timestamp.

In the case of a timestamp with a time zone, the expression is cast to TIMESTAMP without timezone, and then the date portion is extracted.

Example
Date('1991-12-31')   
Example
Date(COL01+100 days)

where COL01 is either a date or timestamp with or without the time zone

Example
Date('1991'||'-12-'||SUBSTR(COL02,1,2))

where COL02 is a var/character field having a valid day number.

Example
Date(22)

returns 0001-01-22

Important

If the argument can be null, the result can be null; if the argument value is null, the result is the null value.


 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*