Re: DATE: valid expression LAST_DAY is not a function in DB2 on Unix/Linux/Windows as far as we know.
Also, the table should not be called TABLE.
The second query looks okay.
BTW I defined the table as follows to test:
create table table1 (attr1 date, attr2 date, attr3 date)
Stefan Bauer wrote:
> Hi NG,
>
> are this actually valid expressions for DB2 v 7.2?
>
> SELECT TABLE.ATTR1
> FROM TABLE
> WHERE
> CURRENT DATE - 1 MONTH <= LAST_DAY(TABLE.ATTR2)
>
> and
>
> SELECT TABLE.ATTR1
> FROM TABLE
> WHERE
> TABLE.ATTR2 <= TABLE.ATTR3
>
> - ATTR2 and ATTR3 are DATE-columns...
>
> Appreciate everyones help!!!
>
> Thanks in Advance,
>
> S.B. |