Friday, 22 February 2013

Calculating Differnece between 2 dates in minutes

select  round((second_date - first_date) * (60 * 24),2) as time_in_minutes
from
  (
    select
    to_date('02/21/2013 01:30:00 PM','mm/dd/yyyy hh:mi:ss am') as first_date
   ,to_date('02/22/2013 01:30:00 PM','mm/dd/yyyy HH:MI:SS AM') as second_date
  from
    dual
  ) dual

No comments:

Post a Comment