Re: Centuries in Oracle SQL * Forms 3.0

From: Steve Edelstein <74160.645_at_CompuServe.COM>
Date: 1995/11/28
Message-ID: <49f7ab$31e$1_at_mhadg.production.compuserve.com>#1/1


PROCEDURE fix_century IS
date_string varchar(11) := name_in('global.date_string');

date_out     varchar(11);
year         number(4);

day_month varchar(7);
begin
if (date_string is null)                      -- No date entered
   then goto no_change;                       -- NO_CHANGE skips out of procedure
end if;
day_month := substr(date_string,1,7);         -- Strip out the day and month
year := (substr(date_string,8,4));            -- Strip out the year
if (year < 50)                                -- Test for the century to be added
   then year := year + 2000;                  -- Add the century to the year
   else year := year + 1900;
end if;
date_out := day_month || to_char(year); -- Concatenate the day-month and year date_out := to_char(to_date(date_out,'DD-MON-YYYY'),'MM/DD/YYYY'); -- Convert the date copy(date_out,name_in('system.cursor_item')); -- Copy the date to the text item <<no_change>> null;
end;
-- 
Steve Edelstein                      VOICE: 212-956-3670
Relational Business Systems          CompuServe: 74160,645
124 West 60th Street  Suite 47C            Author of
New York, NY 10023                    "Learning Oracle Forms"
Received on Tue Nov 28 1995 - 00:00:00 CET

Original text of this message