CREATE OR REPLACE FUNCTION get_weeks_between (v_start_date IN DATE, v_end_date IN DATE)
return number
is
v_no_weeks number;
BEGIN

SELECT TRUNC (v_end_date – v_start_date) / 7
INTO v_no_weeks
FROM dual;
return v_no_weeks;
END;
/

How to get number of weeks between two dates

Leave a Reply

Your email address will not be published. Required fields are marked *

forty seven − = forty two