Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
FUNCTION "DATEDIFF" (
"DATEPART" IN VARCHAR2
, "DATE1" IN DATE
, "DATE2" IN DATE
) RETURN NUMBER IS
BEGIN
if DATEPART = 'Day' Then
RETURN Date1 - Date2;
End if;
if DATEPART = 'Week' Then
Return Trunc((date1 - Date2) / 7);
End if;
if DATEPART = 'Month' Then
RETURN TRUNC((Date1 - DATE2)/30);
End if;
END;
select months_between(sysdate,sysdate-85) Month_diff from dual;
MONTH_DIFF
----------
2.77419355