is
v date;
begin
null;
if to_char(P_DATE,'dd') between 16 and 31 then
SELECT (TRUNC(TO_DATE(P_DATE,'DD-MON-RR'),'MON')+15) INTO V FROM DUAL;
else
SELECT ADD_MONTHS(TRUNC(TO_DATE(P_DATE,'DD-MON-RR'),'MON')+15,-1) INTO V FROM DUAL;
end if;
return v;
end;
//////////////
SELECT MAX(TRUNC(TO_DATE('10-FEB-21','DD-MON-RR'),'MON')+15),MAX(ADD_MONTHS(TRUNC(TO_DATE('10-FEB-21','DD-MON-RR'),'MON')+14,+1)) FROM DUAL;
SELECT (TRUNC(TO_DATE('10-FEB-21','DD-MON-RR'),'MON')+15),(ADD_MONTHS(TRUNC(TO_DATE('10-FEB-21','DD-MON-RR'),'MON')+14,+1)) FROM DUAL;
No comments:
Post a Comment