DB2 Scalar functions - DAY
The DAY function returns the day part of a value.
The schema is SYSIBM.
If the value is a number, it must be a date duration or timestamp duration (SQLSTATE 42815).
If the value is a character string, it must be a valid string representation of a date or timestamp. In a Unicode database, if the value 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 other rules depend on the data type of the argument:
SELECT DAY(PRENDATE) INTO :END_DAY FROM PROJECT WHERE PROJNAME = 'WELD LINE PLANNING'
DAY(DATE1 - DATE2)