Currently I'm doing this in SQL:
select emp_code,in_time,out_time,worked_time,WT,shift_work_time,
case when enable_overtime = 1 and TIMEDIFF(WT,shift_work_time) > 0
then hour(TIMEDIFF(WT,(shift_work_time))) else 0 end as OT
FROM myTable;
I am getting wrong OT at line 8,because shift_work_time is in hours format,so i want to convert shift_worke_time which is in hours to hh:mm:ss how can i do this? Thank you in advance
I have also tried
TIME_FORMAT(shift_worke_time, '%H:%i:%s')
but when shift_worke_time is 10
output is 00:00:10
but it should be
10:00:00