I\'m Trying to get the timediff from my table and convert it to hours (it\'s for an hourly billed service)
SELECT TIME_TO_SEC(TIMEDIFF(endDate,startDa
select hour(timediff('2017-01-01 00:00:00', '2017-01-01 00:01:00'));
return 1
select hour(timediff('2017-01-01 00:01:00', '2017-01-01 00:00:00'));
return 1
select time_to_sec(timediff('2017-01-01 00:00:00', '2017-01-01 00:00:05'));
return -5
select time_to_sec(timediff('2017-01-01 00:00:00', '2017-01-01 00:00:05'))/60 as 'minutes' ;
return -0.0833
if you have the seconds you can convert it as you want or what and hours(..) will not use it when i compare because it's always postive value