DB2 Scalar functions - DAYS
The DAYS function returns an integer representation of a date.
The schema is SYSIBM.
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.
SELECT DAYS(PRENDATE) - DAYS(PRSTDATE) INTO :EDUCATION_DAYS FROM PROJECT WHERE PROJNO = 'IF2000'
SELECT SUM(DAYS(PRENDATE) - DAYS(PRSTDATE)) INTO :TOTAL_DAYS FROM PROJECT WHERE DEPTNO = 'E21'