Submitted Questions

  • how to subtract 2 dates in oracle to get in hour and minute

    I want to subtract 2 dates and represent the result in hour and minute in one decimal figure. I have the following table and i am doing it in this way but the result is not as desired. There is some slight variation, im sure this is simple arithmetic but im not getting it right. select start_time, end_time, (end_time-start_time)*24 from come_leav; START_TIME END_TIME (END_TIME-START_TIME)*24 -------------------...

    Shalini

    • Jul 12th, 2012

    You can try like below.

    select to_number(16.55,99.99)-to_number(14.00,99.99)
    from dual;

  • how to subtract 2 dates to get the result in hour and minute

    Hi there.. I have 2 date fields in my table. I want to subtract these 2 date fields to get the result in hour and minute. Below is what I have and what I am doing but the result is not as I want.. Date1 Date2 date2-date1*24 (is what I am doing) 21-06-2011 14:00:00 21-06-2011 16:55:00 2.9166667 21-06-2011 07:00:00 21-06-2011...