|
|
Archives of the TeradataForum
Message Posted: Wed, 26 May 2004 @ 16:42:03 GMT
Subj: | | Re: Substract 1 year from leap year - bug? |
|
From: | | Hassinger, Bill |
Just my 2 cents. Since not getting the actual last day of the month is problematic either using ADD_Months (6/30/2004, -1) which goes to 5/30,
not 5/31 or '2004-03-31' - Interval '1' which returns an error, we have come up with two solutions:
1) Go to the first day of the month following the month you want the last day for and subtract 1. ADD_Months((date '2004-05-24' -
Extract(day from '2004-05-24')) + 1, -5) -1. The -5 would point to whatever month follows the desired month.
2) Change the syscalendar so the every calendar date has the beginning of the month, end of the month, and end of previous month as
columns in the view.
| |