Hello,
I try with the following query to calculate the working time of employees:
SELECT
TIME_FORMAT(
ADDTIME(
TIMEDIFF(TIMEDIFF(hour_end, hour_begin),(hour_pause)),
TIMEDIFF(TIMEDIFF(hour_end_o, hour_begin_o),(hour_pause_o))
) ,'%H:%i'
) AS total
FROM
hour
This works correct, if the pause is filled, if no pause is given, no total is displayed (NULL). How can I calculate the correct total, when pause is given or not?