DB2 Version 9.7 for Linux, UNIX, and Windows

DAYS scalar function

Read syntax diagramSkip visual syntax diagram
>>-DAYS--(--expression--)--------------------------------------><

The schema is SYSIBM.

The DAYS function returns an integer representation of a date.

The argument must be a DATE, TIMESTAMP, or a valid character string representation of a date, or timestamp that is not a CLOB. In a Unicode database, if a supplied argument is a graphic string (except DBCLOB), it is first converted to a character string before the function is executed.

The result of the function is a large integer. If the argument can be null, the result can be null; if the argument is null, the result is the null value.

The result is 1 more than the number of days from January 1, 0001 to D, where D is the date that would occur if the DATE function were applied to the argument.

Examples