Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Anyone have a 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
Received on Wed Mar 03 1999 - 07:10:13 CST