
SELECT
employee_id,
check_in,
check_out,
TIMEDIFF(check_out, check_in) AS work_duration,
CASE
WHEN TIMEDIFF(check_out, check_in) > '08:00:00' THEN TIMEDIFF(check_out, check_in) - '08:00:00'
ELSE '00:00:00'
END AS overtime_duration
FROM
attendance_records
WHERE
date = '2024-01-15';
利唐i人事HR社区,发布者:HR_learner,转转请注明出处:https://www.ihr360.com/hrnews/20241224184.html
