How to use days between function?


I am looking for a DAYS_BETWEEN function, similar to the MONTHS_BETWEEN
function provided by Oracle.  I would also like to be able to have a more
general form of the ADD_MONTHS function, something like ADD_TO_DATE(
date_to_increment, increment ammount, increment_unit).


You can simply substract two dates to get DAYS_BETWEEN.

FUNCTION DAYS_BETWEEN (d1 DATE, d2 DATE)  RETURN INTEGER IS
BEGIN
   RETURN (d2 - d1);
END;
 

Jarek Palka, KAMSOFT
Katowice, POLAND
 

Hosted by www.Geocities.ws

1