Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Date difference problem in PL/SQL
Mark.Powell_at_eds.com (Mark D Powell) wrote in message news:<2687bb95.0311111126.3f354661_at_posting.google.com>...
> "Paul Tomlinson" <rubberducky703_at_hotmail.com> wrote in message news:<bor0k2$1hhjo0$1_at_ID-116287.news.uni-berlin.de>...
> > Hello,
> >
> > Does anyone have a routine which will return the (total) difference in
> > minutes between two dates?
> >
> > It doesn't look like Oracle provides any fancy date manipulation
> > functions....
> >
> > PT
>
> The difference is expressed in days and fractions thereof so just
> divide by the number of minutes in a day, 1440.
>
> HTH -- Mark D Powell --
OOPS! I meant multiply in this case
select
(to_date('30-10-2003 08:00:00','DD-MM-YYYY hh24:mi:ss') -
to_date('30-10-2003 08:01:00','DD-MM-YYYY hh24:mi:ss')) *
1440 as "Diff in Min"
from sys.dual
/
Diff in Min
HTH -- Mark D Powell -- Received on Tue Nov 11 2003 - 18:51:41 CST