Below Is Data
Create table #EmpMaster (EnrollNumber int, empName varchar(50))
Create table #MonthDate (Day varchar(50),D_Date date)
Create table #AttendenceLOG (EnrollNumber int,A_Date datetime)
Insert into #EmpMaster values (10001,'ALi')
Insert into #EmpMaster values (10002,'Kami')
Insert into #EmpMaster values (10003,'Jhon')
Insert into #EmpMaster values (10004,'Muli')
Insert into #EmpMaster values (10005,'Rose')
Insert into #MonthDate values ('Sunday','2021-06-06')
Insert into #MonthDate values ('Monday','2021-06-07')
Insert into #MonthDate values ('Tuesday','2021-06-08')
Insert into #MonthDate values ('Wednesday','2021-06-09')
Insert into #AttendenceLOG values (10001,'2021-06-09 08:04:00')
Insert into #AttendenceLOG values (10001,'2021-06-09 17:45:00')
Insert into #AttendenceLOG values (10002,'2021-06-09 10:04:00')
Insert into #AttendenceLOG values (10003,'2021-06-09 20:04:00')
Insert into #AttendenceLOG values (10004,'2021-06-09 07:45:00')
Insert into #AttendenceLOG values (10004,'2021-06-09 09:45:00')
Insert into #AttendenceLOG values (10004,'2021-06-09 20:35:00')
Column Detail
EnrollNumber =will come from table empMaster .
D_Date/Day = will come from MonthDate table.
A_Date(IN/Out) = will come from #AttendenceLOG table.
Status = If Day is equal to Sunday then Mentioned 'S'
if IN and Out Time Does not exit of employee ,then mentioned 'A',
if IN/OUT Time found and Hours is equal to 8 hours or more then, then Mentioned 'P' otherwise 'A'




