Subject | Re: [IBO] Date Question |
---|---|
Author | hans@hoogstraat.ca |
Post date | 2001-08-09T23:32:26Z |
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@... wrote:
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@... wrote:
>
> Help,
>
> I'm drawing a blank in Server SQL
>
> Declare Variable OldDate Date;
> Declare Variable NewDate Date;
>
> Declare Variable yy Integer;
> Declare Variable mm Integer;
> Declare Variable dd Integer;
>
> yy = Extract(Year from OldDate);
> mm = Extract(Month from OldDate);
> dd = Extract(Day from OldDate);
>
> yy = yy + 1;
>
> NewDate = PutBackToGether (yy,mm,dd);
>
> What do I use for PutBackToGerher (yy,mm,dd) to get NewDate ??
>
> Best Regards
> Hans
>
>