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

DAY function


The DAY function returns an integer data type.

DAY.png

The expression must return one of the following built-in data types:

  • DATE
  • TIMESTAMP
  • TIMESTAMP WITH TIMEZONE
  • Date duration
  • Timestamp duration

Important

A CHAR/VARCHAR argument is not accepted unless converted by a DATE, TIMESTAMP, or TIMESTAMP_TZ function.

A date duration occurs as the result of subtracting two dates; a timestamp duration occurs as the result of subtracting two timestamps with precision=6. The result is the day portion of the derived date, or date or timestamp, duration.

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

Example
 DAY (DATE ('1991-12-31'))

results in an integer of value = 31

It is invalid to specify DAY (‘1991-12-31’) because the argument is of type CHAR.

Example
DAY (DATE ('1991-12-31')-DATE ('1995-12-31'))  

results in an integer of value = 0


 

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