
02-26-2008, 04:58 PM
|
| |
Re: DATE: valid expression Thank you! :-)
:-)
S.B. tonkuma@jp.ibm.com (Tokunaga T.) wrote in message news:<8156d9ae.0311041559.6b4a17d@posting.google.c om>...
> stefanbauer24@yahoo.de (Stefan Bauer) wrote in message
> > Hi,
> >
> > according to the IBM SQL Reference v. 7, LAST_DAY is a scalar
> > function, that returns a date that represents the last day of the
> > month, but only for UDB OS/390 and z/OS. 
> >
> > I found on the internet some expressions, that seems to provide the
> > same result. Unfortunately, I don't have a DB2-access, so there is no
> > possibility for me to prove, if they are correct:
> >
> > (attr2 + 1 MONTH) - day(attr2 + 1 month) days
> Seems OK.
>
> >
> > (attr2 + 1 MONTH) - day(attr2) days
> NG.
> If attr2 is 2003-01-30, the expression will return 2003-01-29.
>
> >
> > (attr2 + 1 MONTH) - (1 DAY)
> NG. |