how to calculate employee attendace data

94
January 21, 2021, at 01:40 AM

this is the employee_attendance table in mysql in which i have 3 column id, emp_id and office_punch. office_punch is employee in time or out time with date.

 id        emp_id       office_punch
'39570',  'RBT3033',  '2020-12-27 08:39:00.000000'
'39571',  'RBT3033',  '2020-12-27 22:39:00.000000'
'39572',  'RBT3033',  '2020-12-28 22:39:00.000000'
'39573',  'RBT3033',  '2020-12-28 10:39:00.000000'
'39574',  'RBT3033',  '2020-12-29 10:39:00.000000'
'39575',  'RBT3033',  '2020-11-29 10:39:00.000000'
'39576',  'RBT3033',  '2020-10-29 10:39:00.000000'
'39577',  'RBT3033',  '2020-10-29 23:39:00.000000'
'39578',  'RBT3022',  '2020-10-29 23:39:00.000000'
'39579',  'RBT3022',  '2020-10-29 13:39:00.000000'
'39580',  'RBT3022',  '2020-11-29 10:39:00.000000'
'39581',  'RBT3022',  '2020-11-29 09:39:00.000000'
'39582',  'RBT3022',  '2020-11-20 23:39:00.000000'
'39583',  'RBT3022',  '2020-11-20 09:39:00.000000'
'39584',  'RBT3022',  '2020-11-20 20:39:00.000000'
'39585',  'RBT3022',  '2020-11-19 21:39:00.000000'

in above employee_attendance table if employee not present on a particular date then in table no data will be there for that date and if possible then count that date as an absent

I want to calculate employee monthly attendance and for calculating Attendance there are some conditions-:

if min(office_punch) = max(office_punch) then count it as an absent if max(office_punch) - min(office_punch) <=2Hours then count it as an absent

I need Number of present days and Number of absent date of employees per month in a year.

if do in MySql then what the query will be and is it possible to do with java code then what will be the Java code for it.

READ ALSO
Start Application class A from different Application class B in same Android bundle

Start Application class A from different Application class B in same Android bundle

I have Application class A in base module and i want to launch other Application Class B in dynamic feature module

88
Node Schedule with mongoDB

Node Schedule with mongoDB

I want to use Node Schedule to build a module that will backup my serversI have the configuration of the backup periodicity in a MongoDB

88
Snake AI collide with himself when it shouldn&#39;t

Snake AI collide with himself when it shouldn't

I've started to make a snake ai game

61
How can I get data for select box and set the data while using searching?

How can I get data for select box and set the data while using searching?

There is a search function, so when I choose the sort and label select box then click the search button, it will sort dataBut the selected value is not set in the select box

69