3 Replies Latest reply: Oct 11, 2013 3:38 AM by Quy Thanh Lê RSS

    Delta time in decimal not working in a load



      I have some trouble to display a delta time in decimal


      I have a table with an ID, a text, and 2 columns date (dateA, DateB)

      I want to load this table and calculate the delta time between these 2 dates in decimal hour...


      To do so, I made:




           concat(text, '/') as "text",

           sum(interval(DateA-DateB, 's') )as "Delta"

      Resident Table GROUP BY ID;


      My delta is in seconds but I can't convert it into decimal hour... When I try to put / 3600, the result is not as expected.


      For example : Delta = 82500s, I should have 22.92 in Delta when I divide by 3600... But when I try to do sum(interval(DateA-DateB, 's') /3600), the result is 0.00265....


      Does anyone have an idea ?

      Thank you in advance for your reply