Subject | Re: [ib-support] Re: [IBO] Date Question |
---|---|
Author | Nando Dessena |
Post date | 2001-08-10T07:52:32Z |
Hans,
years.
Ciao
--
____
_/\/ando
> I found a solution, maybe not the best, but it seems to work :)it won't work if curdate is 02/29/2004. You should account for leap
>
> PROCEDURE THIS_DAY_NEXT_YEAR (CURDATE DATE)
> RETURNS (NEXTDATE DATE)
> AS
> DECLARE VARIABLE YY INTEGER;
> DECLARE VARIABLE MM INTEGER;
> DECLARE VARIABLE DD INTEGER;
> BEGIN
> YY = Extract(Year from CURDATE);
> MM = Extract(Month from CURDATE);
> DD = Extract(Day from CURDATE);
>
> NEXTDATE = Cast(mm as char(2))
> || '/' || Cast(dd as char(2))
> || '/' || Cast(yy+1 as char(4));
>
> SUSPEND;
> END
years.
Ciao
--
____
_/\/ando