Sample Header Ad - 728x90

How to Count calculated work hours in one month for each labors

0 votes
0 answers
58 views
Good Day. I have some data like bellow id name in out 1 lala 2023-09-29 07:00:00 2023-09-29 17:00:00 2 lili 2023-09-29 07:30:00 2023-09-29 16:00:00 1 lala 2023-09-30 07:00:00 2023-09-30 17:30:00 2 lili 2023-09-30 07:00:00 2023-09-30 16:00:00 how to calculate total work hours even different day on example table record. the result i wanted like bellow. id name total_hours 1 lala 20.5 2 lili 17.5 i also try to use this query SELECT global_id as id, beacon_name,IFNULL(MIN(case when in_out_flag = 'IN' then received_date end),"") as in, IFNULL(MAX(case when in_out_flag = 'OUT' then received_date end),"") as out WHERE (date(received_date) BETWEEN '2023-07-01' and '2023-07-05') group by global_id ,date(received_date); but I only get the record per day only, i want to get all total work hours in one month. Thank You. Regards.
Asked by epm.007 (29 rep)
Sep 30, 2023, 04:23 AM
Last activity: Sep 30, 2023, 09:59 AM