Re: question about subtracting dates

From: Adam Sandler <>
Date: Fri, 12 Sep 2008 08:01:40 -0700 (PDT)
Message-ID: <>

On Sep 11, 4:46 pm, hpuxrac <> wrote: >> Any reason you don't want to use oracle provided functionality like
> days_between

As you sure Oracle has a days_between function? There's a months_between but when I try days_between, I get SQL Error: ORA-00904: "DAYS_BETWEEN": invalid identifier

I googled days_between and just about every site says there is no such function built in and those sites show some PL/SQL. Guess what, in their code there always seems to be a line "date - date".

date - date is the same thing which is in the existing code. It's just that the years don't seem to be a part of the equation. The answer to 15 Nov - 11 Jun is indeed 157. However, the answer to 15 Nov 1994 - 11 Jun 2094 cannot be 157. Received on Fri Sep 12 2008 - 10:01:40 CDT

Original text of this message