Hi,
thanks for you reply!
AFAIK LAST_DAY is a scalar function only for DB2 Universal Database for OS/390 and z/OS.

I found this SQL statement on SearchDatabase, that calculates the last day of a month too:
(DATE('02/01/2000') + 1 MONTH) - DAY(DATE('02/01/2000')) DAYS
with the result "02/29/2000".
Unfortunately, I sill don't have a DB2-account, so I cann't prove, if the statements provide the same result.
The only drifference seems to be "+ 1 MONTH" in the last part of the expression...
S.B.
Quote:
Originally posted by chimes1967
They are valid sql statements, but they will not get you the last day of the month.
|