you need to sum up and then format
TIME_FORMAT(SUM(TIMEDIFF(eTime, sTime),'%d d %k h %i m')) AS tTime FROM Business
题
I tried summing up:
SUM(TIME_FORMAT(TIMEDIFF(eTime, sTime),'%d d %k h %i m')) AS the_Time FROM Business
However, if I remove SUM it displays the format I want. If I add SUM then it returns null. Can anyone tell me how to sum up date and time?
解决方案
you need to sum up and then format
TIME_FORMAT(SUM(TIMEDIFF(eTime, sTime),'%d d %k h %i m')) AS tTime FROM Business