Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: newbie question with cursors/dates
Hi!
Difference between 2 dates is returned in days. Each day contain 1440 minutes, so you need to multiply you difference just by this number:
select (sysdate - (sysdate-1/24))*1440 from dual; returns
60.0000000000000000000000000000000000001minutes, which is correct.
Andrew Velichko
Brainbench MVP for Oracle Developer 2000
http://www.brainbench.com
"MindSpring User" <sallsopp_at_mindspring.com> wrote in message
news:98gg45$v9j$1_at_slb5.atl.mindspring.net...
> Hi,
> I am very new to ORACLE coming from an Access developers background.
I
> am trying to pull two dates from records in a table (called Hold_Red) and
> calculate total time elapsed. If any of the times overlap from any
previous
> times, that amount of time must NOT be double counted. I am sure I need a
> cursor to pull out just the records that I need, but how do I set my
inital
> values outside of the cursor? The inital variables should be equal to the
> first records values. I think my logic is correct from there, except that
I
> do not understand how to use the date difference to calculate minutes. I
> thought if I subtracted the two and multiplied by the number of minutes in
a
> day, I would get the value in minutes, but it always comes up with zero.
> This may ofcourse be because I do not have my variable initialized
properly!
> Please help!
> Thanks
> S. Allsopp
>
>
>
Received on Sun Mar 11 2001 - 13:11:27 CST
![]() |
![]() |