11,637,415 members (64,344 online)
Rate this:
See more:
Below is my Query :
Quote:
Select a.Sent, b.Recd, ((b.Recd-a.Sent)*1440) DIFF
from TableA b, TableB a
where b.type = 'AAA'
and b.ID = a.ID1

Where ID and ID1 are foreign Key
Both sent, Recd dates are in format like '
Quote:
5/9/2011 5:22:00 PM
'

But i am not getting :
Quote:
((b.Recd-a.Sent)*1440)
in minutes
Quote:
-000000000 06:48:00

I need the difference of DATE in Minutes only.

Posted 4-Feb-13 5:43am
Nibin22644
Edited 4-Feb-13 5:44am
v2

Rate this:

## Solution 1

SELECT
trunc(DATE1-DATE2) days,
mod( trunc( ( DATE1-DATE2 ) * 24 ), 24) HOURS,
mod( trunc( ( DATE1-DATE2 ) * 1440 ), 60 ) MINUTES,
mod( trunc( ( DATE1-DATE2 ) * 86400 ), 60 ) SECONDS
FROM dual;
change as per ur table

http://stackoverflow.com/questions/206222/oracle-best-select-statement-for-getting-the-difference-in-minutes-between-two[^]
Nibin22 at 4-Feb-13 23:39pm

It is Working !!! Thanks :)
Rate this:

## Solution 2

This should do it:
select
round((second_date - first_date) * 1440,2)
You need to round the value.
Nibin22 at 4-Feb-13 23:39pm

It is Working !!! Thanks :)
Rate this:

## Solution 3

I suggest that you try using the NUMTODSINTERVAL[^] function with the second parameter of 'MINUTE'.

NUMTODSINTERVAL(b.recd - a.sent, 'MINUTE')
Nibin22 at 4-Feb-13 23:39pm

It is Working !!! Thanks :)
Rate this:

## Solution 4

Thanks Friends,

I figured like below :

Select a.Sent, b.Recd, (Extract Minute from b.Recd-a.Sent) DIFF
from TableA a, TableB b
where b.type = 'AAA'
and b.ID = a.ID1;

Where " (Extract Minute from b.Recd-a.Sent) DIFF" returns the date difference in MINUTES
Nibin22 at 4-Feb-13 23:38pm

Nice!!! I didnt imagine this number of solutions will be there to find the date difference!!!

Thanks a lot Guys !!!! :)