Subject Re: [ib-support] Re: [IBO] Date Question
Author Helen Borrie
At 05:32 PM 09-08-01 -0600, you wrote:
>I found a solution, maybe not the best, but it seems to work :)
>
>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


Hans,
You can simply add a year (365 or 366). Hmm, you're still going to have to decode the date to determine whether it's Leap Year, though. Sounds like something that is crying out for a UDF.

regards,
Helen




All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________