Or....
If you want a simple function do return a new date when specifing 'D' for day 'W' for week you could try the following
This would give the following output:Code:CREATE OR REPLACE FUNCTION date_advance (curr_date IN date, adv_flag in varchar) RETURN date IS BEGIN IF adv_flag = 'D' THEN RETURN curr_date+1; ELSIF adv_flag ='W' THEN RETURN curr_date+7; ELSE RETURN curr_date; END IF; END date_advance;
RegardsCode:SQL> select date_advance(sysdate,'D') from dual; DATE_ADVA --------- 14-JAN-03




Reply With Quote