INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B3113'
AND '11 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'11 Aug 2022','Sick','11 Aug 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B3204'
AND '11 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'11 Oct 2022','Sick','11 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B3375'
AND '27 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'27 Mar 2023','Sick','27 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B3910'
AND '30 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'30 May 2023','Sick','31 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B3910'
AND '20 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'20 Dec 2022','Sick','21 Dec 2022', 0,0,1,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B3910'
AND '01 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'01 Nov 2022','Sick','01 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B3910'
AND '10 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'10 Aug 2022','Sick','10 Aug 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B4450'
AND '22 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'22 Mar 2023','Sick','24 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B4450'
AND '05 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'05 Dec 2022','Unpaid Leave','05 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B4595'
AND '03 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Jan 2023','Sick','04 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B4595'
AND '28 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Nov 2022','Sick','28 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B4947'
AND '17 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'17 Feb 2023','Sick','17 Feb 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B5038'
AND '26 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'26 Sep 2022','Sick','26 Sep 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B5137'
AND '19 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'19 Jul 2022','Sick','22 Jul 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B5172'
AND '22 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'22 Aug 2022','Compassionate Leave','22 Aug 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B5833'
AND '30 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'30 Jun 2023','Sick','30 Jun 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B5833'
AND '28 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Jun 2023','Sick','28 Jun 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B5850'
AND '20 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'20 Feb 2023','Sick','06 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B5850'
AND '17 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'17 Oct 2022','Sick','24 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B5850'
AND '10 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'10 Oct 2022','Sick','14 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B5898'
AND '08 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'08 Mar 2023','Sick','08 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B5898'
AND '21 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'21 Dec 2022','Sick','21 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B5898'
AND '10 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'10 Nov 2022','Sick','10 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B5901'
AND '05 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'05 Jun 2023','Sick','05 Jun 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B5901'
AND '29 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'29 Mar 2023','Sick','29 Mar 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B5967'
AND '04 Jul 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'04 Jul 2023','Sick','04 Jul 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B5967'
AND '17 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'17 Apr 2023','Sick','18 Apr 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B6002'
AND '08 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'08 Mar 2023','Sick','09 Mar 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B6002'
AND '03 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Jan 2023','Sick','05 Jan 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B6002'
AND '07 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'07 Dec 2022','Sick','07 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B6080'
AND '14 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Jun 2023','Sick','15 Jun 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B6265'
AND '15 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 May 2023','Sick','17 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B6325'
AND '21 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'21 Nov 2022','Sick','25 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B6325'
AND '07 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'07 Jul 2022','Sick','07 Jul 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B6348'
AND '20 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'20 Mar 2023','Sick','20 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B6363'
AND '21 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'21 Feb 2023','Sick','22 Feb 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B6472'
AND '07 Jul 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'07 Jul 2023','Sick','07 Jul 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B6472'
AND '09 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'09 Feb 2023','Sick','09 Feb 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B6472'
AND '15 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 Aug 2022','Sick','16 Aug 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B6495'
AND '20 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'20 Dec 2022','Sick','21 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B6544'
AND '13 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Oct 2022','Sick','13 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B6544'
AND '30 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'30 Sep 2022','Sick','30 Sep 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B6544'
AND '28 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Sep 2022','Sick','29 Sep 2022', 0,0,1,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B6604'
AND '28 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Jun 2023','Sick','28 Jun 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B6604'
AND '26 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'26 Jun 2023','Sick','26 Jun 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B6636'
AND '29 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'29 Nov 2022','Sick','29 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B6699'
AND '22 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'22 Feb 2023','Sick','22 Mar 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B6699'
AND '24 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'24 Nov 2022','Sick','24 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B6699'
AND '02 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'02 Nov 2022','Sick','02 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7027'
AND '29 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'29 Jun 2023','Sick','29 Jun 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7027'
AND '31 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'31 May 2023','Sick','01 Jun 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7027'
AND '10 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'10 May 2023','Sick','10 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7027'
AND '03 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Apr 2023','Sick','04 Apr 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7027'
AND '06 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Mar 2023','Sick','17 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7027'
AND '09 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'09 Feb 2023','Sick','10 Feb 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7027'
AND '14 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Nov 2022','Sick','15 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7027'
AND '04 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'04 Oct 2022','Sick','04 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7027'
AND '08 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'08 Sep 2022','Sick','08 Sep 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7027'
AND '28 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Jul 2022','Sick','28 Jul 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7081'
AND '26 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'26 Jan 2023','Sick','26 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7134'
AND '23 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'23 Mar 2023','Sick','24 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7134'
AND '27 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'27 Feb 2023','Sick','27 Feb 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7134'
AND '05 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'05 Dec 2022','Sick','05 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7138'
AND '10 Jul 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'10 Jul 2023','Sick','21 Jul 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7138'
AND '14 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Jun 2023','Sick','30 Jun 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7183'
AND '03 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Apr 2023','Sick','03 Apr 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7183'
AND '03 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Oct 2022','Sick','03 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7183'
AND '11 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'11 Jul 2022','Sick','11 Jul 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7188'
AND '11 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'11 Jan 2023','Sick','12 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7246'
AND '19 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'19 Apr 2023','Sick','19 Apr 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7246'
AND '06 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Jan 2023','Sick','10 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7246'
AND '01 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'01 Jul 2022','Sick','01 Jul 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7280'
AND '22 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'22 Jun 2023','Sick','22 Jun 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7280'
AND '06 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Apr 2023','Sick','06 Apr 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7285'
AND '05 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'05 Sep 2022','Sick','16 Sep 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7309'
AND '24 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'24 Aug 2022','Sick','24 Aug 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7357'
AND '28 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Mar 2023','Sick','30 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7357'
AND '26 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'26 Jul 2022','Sick','28 Jul 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7405'
AND '05 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'05 Oct 2022','Sick','05 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7406'
AND '07 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'07 Mar 2023','Sick','07 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7406'
AND '02 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'02 Dec 2022','Sick','02 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7472'
AND '01 Jul 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'01 Jul 2023','Sick','31 Jul 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7472'
AND '30 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'30 May 2023','Sick','02 Jun 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7472'
AND '15 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 May 2023','Sick','26 May 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7472'
AND '12 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'12 May 2023','Sick','12 May 2023', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7472'
AND '11 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'11 May 2023','Sick','11 May 2023', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7472'
AND '10 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'10 May 2023','Sick','10 May 2023', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7472'
AND '09 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'09 May 2023','Sick','09 May 2023', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7472'
AND '05 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'05 May 2023','Sick','05 May 2023', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7472'
AND '04 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'04 May 2023','Sick','04 May 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7472'
AND '03 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 May 2023','Sick','03 May 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7472'
AND '02 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'02 May 2023','Sick','02 May 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7472'
AND '27 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'27 Apr 2023','Sick','28 Apr 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7472'
AND '26 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'26 Apr 2023','Sick','26 Apr 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7472'
AND '25 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'25 Apr 2023','Sick','25 Apr 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7472'
AND '13 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Apr 2023','Sick','14 Apr 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7472'
AND '05 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'05 Apr 2023','Sick','06 Apr 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7472'
AND '13 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Feb 2023','Sick','31 Mar 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7472'
AND '09 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'09 Feb 2023','Sick','09 Feb 2023', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7472'
AND '25 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'25 Jan 2023','Sick','26 Jan 2023', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7472'
AND '18 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'18 Jan 2023','Sick','18 Jan 2023', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7472'
AND '30 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'30 Dec 2022','Sick','30 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7472'
AND '21 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'21 Dec 2022','Sick','23 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7472'
AND '12 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'12 Dec 2022','Sick','16 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7472'
AND '30 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'30 Nov 2022','Sick','09 Dec 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7472'
AND '18 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'18 Aug 2022','Sick','18 Aug 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7472'
AND '13 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Jul 2022','Sick','15 Jul 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7472'
AND '12 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'12 Jul 2022','Sick','12 Jul 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7472'
AND '11 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'11 Jul 2022','Sick','11 Jul 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7472'
AND '04 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'04 Jul 2022','Sick','04 Jul 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7517'
AND '09 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'09 Jun 2023','Sick','09 Jun 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7517'
AND '23 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'23 Feb 2023','Sick','23 Feb 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7556'
AND '06 Jul 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Jul 2023','Sick','06 Jul 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7556'
AND '17 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'17 May 2023','Sick','17 May 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7556'
AND '11 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'11 May 2023','Sick','11 May 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7556'
AND '10 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'10 May 2023','Sick','10 May 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7564'
AND '20 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'20 Feb 2023','Sick','21 Feb 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7592'
AND '19 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'19 Jun 2023','Sick','07 Jul 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7592'
AND '21 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'21 Nov 2022','Sick','21 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7602'
AND '13 Jul 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Jul 2023','Sick','13 Jul 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7602'
AND '10 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'10 Mar 2023','Sick','10 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7619'
AND '27 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'27 Mar 2023','Sick','27 Mar 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7619'
AND '06 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Mar 2023','Sick','06 Mar 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7619'
AND '03 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Oct 2022','Sick','03 Oct 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7619'
AND '30 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'30 Sep 2022','Sick','30 Sep 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7619'
AND '24 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'24 Sep 2022','Sick','24 Sep 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7627'
AND '13 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Feb 2023','Dependant Leave','13 Feb 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7627'
AND '17 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'17 Oct 2022','Sick','19 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7633'
AND '14 Jul 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Jul 2023','Sick','14 Jul 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7633'
AND '08 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'08 Jun 2023','Sick','08 Jun 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7633'
AND '07 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'07 Mar 2023','Sick','07 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7633'
AND '09 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'09 Dec 2022','Sick','09 Dec 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7633'
AND '29 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'29 Nov 2022','Sick','29 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7633'
AND '13 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Sep 2022','Sick','13 Sep 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7636'
AND '24 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'24 Apr 2023','Sick','24 Apr 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7636'
AND '21 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'21 Dec 2022','Sick','22 Dec 2022', 0,0,1,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7636'
AND '12 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'12 Aug 2022','Sick','12 Aug 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7652'
AND '22 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'22 May 2023','Sick','23 May 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7652'
AND '27 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'27 Feb 2023','Sick','27 Feb 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7652'
AND '30 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'30 Dec 2022','Unpaid Leave','30 Dec 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7652'
AND '28 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Dec 2022','Unpaid Leave','29 Dec 2022', 0,0,1,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7652'
AND '27 Jun 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'27 Jun 2022','Sick','22 Jul 2022', 0,0,1,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7681'
AND '06 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Apr 2023','Sick','06 Apr 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7681'
AND '24 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'24 Oct 2022','Sick','24 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7685'
AND '16 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'16 May 2023','Sick','17 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7685'
AND '24 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'24 Feb 2023','Sick','03 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7685'
AND '24 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'24 Jan 2023','Sick','24 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7685'
AND '15 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 Nov 2022','Sick','16 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7685'
AND '04 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'04 Jul 2022','Sick','06 Jul 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7702'
AND '22 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'22 May 2023','Sick','22 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7702'
AND '19 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'19 May 2023','Sick','19 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7702'
AND '31 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'31 Aug 2022','Sick','02 Sep 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7708'
AND '25 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'25 May 2023','Sick','25 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7708'
AND '17 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'17 Apr 2023','Sick','25 Apr 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7708'
AND '13 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Apr 2023','Sick','14 Apr 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7708'
AND '06 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Feb 2023','Sick','07 Feb 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7708'
AND '24 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'24 Aug 2022','Sick','24 Aug 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7709'
AND '29 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'29 Jun 2023','Dependant Leave','29 Jun 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7709'
AND '27 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'27 Jun 2023','Dependant Leave','27 Jun 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7709'
AND '26 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'26 Apr 2023','Sick','27 Apr 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7709'
AND '28 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Mar 2023','Sick','30 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7709'
AND '06 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Mar 2023','Sick','06 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7709'
AND '02 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'02 Mar 2023','Sick','02 Mar 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7709'
AND '14 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Nov 2022','Sick','15 Nov 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7709'
AND '16 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'16 Aug 2022','Sick','18 Aug 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7733'
AND '12 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'12 May 2023','Sick','12 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7733'
AND '07 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'07 Mar 2023','Sick','08 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7733'
AND '28 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Sep 2022','Sick','28 Sep 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7733'
AND '17 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'17 Aug 2022','Sick','17 Aug 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7779'
AND '17 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'17 Mar 2023','Sick','17 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7779'
AND '15 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 Nov 2022','Sick','15 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7779'
AND '22 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'22 Jul 2022','Sick','28 Jul 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7799'
AND '01 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'01 Feb 2023','Sick','02 Feb 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7799'
AND '14 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Dec 2022','Sick','14 Dec 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7799'
AND '19 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'19 Oct 2022','Sick','19 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7799'
AND '30 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'30 Aug 2022','Sick','02 Sep 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7799'
AND '26 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'26 Aug 2022','Sick','26 Aug 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7799'
AND '04 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'04 Aug 2022','Sick','04 Aug 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7834'
AND '05 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'05 Aug 2022','Sick','05 Aug 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7835'
AND '15 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 May 2023','Sick','19 May 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7835'
AND '09 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'09 May 2023','Sick','12 May 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7835'
AND '02 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'02 May 2023','Sick','05 May 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7835'
AND '27 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'27 Apr 2023','Sick','30 Apr 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7835'
AND '24 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'24 Apr 2023','Sick','24 Apr 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7835'
AND '20 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'20 Sep 2022','Sick','27 Sep 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7835'
AND '06 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Sep 2022','Sick','16 Sep 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7835'
AND '19 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'19 Jul 2022','Sick','19 Jul 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7846'
AND '09 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'09 Dec 2022','Sick','09 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7846'
AND '06 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Dec 2022','Sick','07 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7846'
AND '21 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'21 Oct 2022','Sick','25 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7846'
AND '10 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'10 Oct 2022','Sick','10 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7847'
AND '03 Jul 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Jul 2023','Sick','03 Jul 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7847'
AND '30 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'30 May 2023','Sick','02 Jun 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7847'
AND '04 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'04 May 2023','Sick','05 May 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7847'
AND '17 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'17 Jan 2023','Unpaid Leave','17 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7847'
AND '15 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 Dec 2022','Dependant Leave','15 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7847'
AND '17 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'17 Oct 2022','Sick','17 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7912'
AND '15 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 Jul 2022','Sick','15 Jul 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7922'
AND '07 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'07 Mar 2023','Sick','07 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7940'
AND '30 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'30 Jan 2023','Sick','31 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7940'
AND '15 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 Aug 2022','Sick','15 Aug 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7986'
AND '10 Jul 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'10 Jul 2023','Sick','14 Jul 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7986'
AND '10 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'10 May 2023','Sick','10 May 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B7993'
AND '23 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'23 Jan 2023','Sick','24 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8016'
AND '03 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Oct 2022','Sick','03 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8035'
AND '19 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'19 Apr 2023','Sick','21 Apr 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8035'
AND '02 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'02 Mar 2023','Sick','06 Mar 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8035'
AND '10 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'10 Feb 2023','Sick','10 Feb 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8035'
AND '16 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'16 Dec 2022','Sick','16 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8035'
AND '14 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Nov 2022','Sick','25 Nov 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8035'
AND '17 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'17 Oct 2022','Sick','18 Oct 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8035'
AND '14 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Oct 2022','Sick','14 Oct 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8035'
AND '29 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'29 Sep 2022','Sick','30 Sep 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8035'
AND '11 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'11 Aug 2022','Sick','12 Aug 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8062'
AND '10 Jul 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'10 Jul 2023','Sick','12 Jul 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8062'
AND '13 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Mar 2023','Sick','13 Mar 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8062'
AND '05 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'05 Sep 2022','Sick','05 Sep 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8073'
AND '09 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'09 Jan 2023','Sick','10 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8073'
AND '06 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Jan 2023','Sick','06 Jan 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8073'
AND '15 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 Nov 2022','Sick','15 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8073'
AND '17 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'17 Oct 2022','Sick','17 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8073'
AND '14 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Jul 2022','Sick','14 Jul 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8085'
AND '26 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'26 Sep 2022','Sick','27 Sep 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8102'
AND '19 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'19 Dec 2022','Sick','19 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8102'
AND '15 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 Jul 2022','Sick','15 Jul 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8105'
AND '06 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Mar 2023','Sick','06 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8105'
AND '09 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'09 Jan 2023','Sick','09 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8105'
AND '22 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'22 Sep 2022','Compassionate Leave','23 Sep 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8105'
AND '16 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'16 Aug 2022','Compassionate Leave','16 Aug 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8105'
AND '15 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 Aug 2022','Compassionate Leave','15 Aug 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8113'
AND '18 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'18 Jul 2022','Sick','20 Jul 2022', 0,0,1,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8118'
AND '03 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Feb 2023','Sick','03 Feb 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8118'
AND '14 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Dec 2022','Sick','14 Dec 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8126'
AND '14 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Nov 2022','Dependant Leave','14 Nov 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8126'
AND '02 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'02 Nov 2022','Sick','02 Nov 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8126'
AND '02 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'02 Nov 2022','Sick','04 Nov 2022', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8132'
AND '12 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'12 Jun 2023','Sick','26 Jun 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8132'
AND '30 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'30 Mar 2023','Dependant Leave','30 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8132'
AND '03 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Mar 2023','Sick','03 Mar 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8132'
AND '17 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'17 Oct 2022','Sick','18 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8132'
AND '06 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Oct 2022','Sick','14 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8145'
AND '27 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'27 Feb 2023','Unpaid Leave','12 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8145'
AND '22 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'22 Feb 2023','Sick','24 Feb 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8145'
AND '13 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Feb 2023','Unpaid Leave','17 Feb 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8145'
AND '07 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'07 Feb 2023','Unpaid Leave','10 Feb 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8145'
AND '19 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'19 Jan 2023','Unpaid Leave','24 Jan 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8145'
AND '03 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Jan 2023','Sick','03 Jan 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8145'
AND '28 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Dec 2022','Sick','30 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8145'
AND '05 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'05 Dec 2022','Sick','23 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8145'
AND '30 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'30 Nov 2022','Sick','02 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8145'
AND '17 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'17 Nov 2022','Sick','17 Nov 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8145'
AND '09 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'09 Nov 2022','Unpaid Leave','09 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8145'
AND '07 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'07 Nov 2022','Sick','08 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8145'
AND '24 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'24 Oct 2022','Sick','25 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8145'
AND '23 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'23 Sep 2022','Sick','23 Sep 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8145'
AND '15 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 Aug 2022','Sick','16 Aug 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8145'
AND '06 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Jul 2022','Sick','07 Jul 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8146'
AND '26 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'26 Jun 2023','Sick','28 Jun 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8146'
AND '31 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'31 Jan 2023','Sick','02 Feb 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8146'
AND '06 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Dec 2022','Sick','07 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8146'
AND '31 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'31 Oct 2022','Dependant Leave','03 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8146'
AND '03 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Oct 2022','Sick','04 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8148'
AND '07 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'07 Oct 2022','Sick','07 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8157'
AND '07 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'07 Nov 2022','Sick','10 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8162'
AND '07 Jul 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'07 Jul 2023','Sick','10 Jul 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8162'
AND '27 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'27 Feb 2023','Sick','27 Feb 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8162'
AND '03 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Jan 2023','Sick','05 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8162'
AND '23 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'23 Sep 2022','Sick','26 Sep 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8174'
AND '23 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'23 Nov 2022','Sick','02 Dec 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8174'
AND '07 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'07 Nov 2022','Sick','07 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8175'
AND '01 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'01 Jul 2022','Unpaid Leave','02 Sep 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8207'
AND '14 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Jun 2023','Sick','15 Jun 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8207'
AND '27 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'27 Mar 2023','Sick','27 Mar 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8215'
AND '18 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'18 Nov 2022','Sick','18 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8219'
AND '04 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'04 Jan 2023','Sick','05 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8219'
AND '10 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'10 Oct 2022','Sick','10 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8219'
AND '13 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Sep 2022','Sick','13 Sep 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8221'
AND '20 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'20 Mar 2023','Sick','20 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8221'
AND '10 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'10 Feb 2023','Sick','10 Feb 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8221'
AND '03 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Jan 2023','Sick','03 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8221'
AND '30 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'30 Dec 2022','Sick','30 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8221'
AND '18 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'18 Oct 2022','Sick','18 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8221'
AND '21 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'21 Jul 2022','Sick','21 Jul 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8222'
AND '22 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'22 May 2023','Sick','23 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8222'
AND '06 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Dec 2022','Sick','08 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8222'
AND '28 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Sep 2022','Sick','28 Sep 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8233'
AND '19 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'19 Oct 2022','Sick','20 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8236'
AND '19 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'19 May 2023','Sick','19 May 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8238'
AND '03 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Oct 2022','Sick','07 Oct 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8238'
AND '08 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'08 Aug 2022','Sick','08 Aug 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8241'
AND '17 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'17 Jan 2023','Sick','17 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8241'
AND '28 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Nov 2022','Sick','28 Nov 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8241'
AND '06 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Jul 2022','Sick','07 Jul 2022', 0,0,1,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8241'
AND '05 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'05 Jul 2022','Sick','05 Jul 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8258'
AND '13 Jul 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Jul 2023','Sick','14 Jul 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8262'
AND '14 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Apr 2023','Sick','14 Apr 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8262'
AND '19 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'19 Dec 2022','Sick','20 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8262'
AND '16 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'16 Nov 2022','Sick','17 Nov 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8264'
AND '30 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'30 Dec 2022','Sick','30 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8269'
AND '08 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'08 Mar 2023','Sick','08 Mar 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8269'
AND '06 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Dec 2022','Sick','07 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8269'
AND '07 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'07 Sep 2022','Sick','08 Sep 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8269'
AND '11 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'11 Jul 2022','Sick','12 Jul 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8282'
AND '05 Jul 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'05 Jul 2023','Sick','14 Jul 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8282'
AND '30 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'30 May 2023','Sick','02 Jun 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8286'
AND '07 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'07 Jun 2023','Sick','07 Jun 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8288'
AND '03 Jul 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Jul 2023','Sick','04 Jul 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8288'
AND '23 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'23 Jun 2023','Sick','23 Jun 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8288'
AND '05 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'05 Jun 2023','Sick','05 Jun 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8288'
AND '08 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'08 Mar 2023','Sick','08 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8288'
AND '18 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'18 Oct 2022','Sick','21 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8289'
AND '05 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'05 Dec 2022','Sick','05 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8289'
AND '24 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'24 Nov 2022','Sick','25 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8289'
AND '12 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'12 Oct 2022','Sick','17 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8289'
AND '05 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'05 Oct 2022','Sick','05 Oct 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8289'
AND '18 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'18 Jul 2022','Sick','20 Jul 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8294'
AND '08 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'08 Sep 2022','Sick','08 Sep 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8294'
AND '28 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Jul 2022','Sick','03 Aug 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8295'
AND '07 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'07 Oct 2022','Sick','07 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8296'
AND '06 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Feb 2023','Sick','10 Feb 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8296'
AND '09 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'09 Dec 2022','Sick','09 Dec 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8296'
AND '21 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'21 Sep 2022','Sick','22 Sep 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8296'
AND '04 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'04 Jul 2022','Sick','06 Jul 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8299'
AND '01 Jul 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'01 Jul 2023','Sick','31 Jul 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8299'
AND '12 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'12 Jun 2023','Sick','16 Jun 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8299'
AND '09 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'09 Jun 2023','Unpaid Leave','09 Jun 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8299'
AND '07 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'07 Jun 2023','Sick','08 Jun 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8299'
AND '01 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'01 Jun 2023','Sick','01 Jun 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8299'
AND '17 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'17 May 2023','Sick','17 May 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8299'
AND '16 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'16 May 2023','Sick','16 May 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8299'
AND '14 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Dec 2022','Sick','20 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8299'
AND '11 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'11 Oct 2022','Sick','11 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8299'
AND '01 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'01 Sep 2022','Sick','06 Sep 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8301'
AND '15 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 Dec 2022','Sick','16 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8304'
AND '30 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'30 May 2023','Sick','09 Jun 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8304'
AND '22 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'22 May 2023','Sick','26 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8304'
AND '13 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Apr 2023','Sick','13 Apr 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8304'
AND '13 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Mar 2023','Sick','13 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8304'
AND '13 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Feb 2023','Sick','13 Feb 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8304'
AND '27 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'27 Oct 2022','Sick','27 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8304'
AND '18 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'18 Jul 2022','Sick','18 Jul 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8305'
AND '06 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Jun 2023','Sick','11 Jul 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8305'
AND '01 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'01 Feb 2023','Sick','27 Feb 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8305'
AND '06 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Jan 2023','Sick','27 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8305'
AND '24 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'24 Nov 2022','Sick','24 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8311'
AND '14 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Dec 2022','Sick','16 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8319'
AND '22 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'22 May 2023','Sick','22 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8319'
AND '20 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'20 Mar 2023','Sick','20 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8322'
AND '05 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'05 May 2023','Unpaid Leave','05 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8322'
AND '14 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Feb 2023','Sick','14 Feb 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8325'
AND '12 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'12 Sep 2022','Sick','12 Sep 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8326'
AND '05 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'05 Jun 2023','Sick','30 Jun 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8326'
AND '02 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'02 Jan 2023','Unpaid Leave','13 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8330'
AND '21 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'21 Mar 2023','Sick','21 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8330'
AND '10 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'10 Aug 2022','Sick','10 Aug 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8339'
AND '27 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'27 Feb 2023','Sick','06 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8339'
AND '09 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'09 Jan 2023','Sick','13 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8339'
AND '20 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'20 Sep 2022','Sick','20 Sep 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8343'
AND '17 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'17 Aug 2022','Sick','17 Aug 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8346'
AND '16 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'16 Feb 2023','Sick','16 Feb 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8349'
AND '26 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'26 Jan 2023','Sick','27 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8349'
AND '17 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'17 Sep 2022','Sick','18 Sep 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8349'
AND '23 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'23 Aug 2022','Compassionate Leave','26 Aug 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8356'
AND '23 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'23 Jun 2023','Sick','20 Jul 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8356'
AND '09 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'09 Jun 2023','Sick','09 Jun 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8356'
AND '05 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'05 May 2023','Sick','05 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8356'
AND '31 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'31 Mar 2023','Sick','31 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8360'
AND '18 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'18 Oct 2022','Unpaid Leave','20 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8360'
AND '17 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'17 Oct 2022','Compassionate Leave','17 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8360'
AND '14 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Oct 2022','Compassionate Leave','14 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8360'
AND '11 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'11 Jul 2022','Sick','11 Jul 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8365'
AND '23 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'23 Sep 2022','Sick','23 Sep 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8368'
AND '18 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'18 Apr 2023','Sick','19 Apr 2023', 0,0,1,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8368'
AND '09 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'09 Mar 2023','Sick','10 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8368'
AND '14 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Dec 2022','Sick','19 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8368'
AND '06 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Jul 2022','Sick','07 Jul 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8382'
AND '26 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'26 May 2023','Sick','26 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8382'
AND '15 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 May 2023','Sick','15 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8382'
AND '20 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'20 Feb 2023','Sick','20 Feb 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8392'
AND '03 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Feb 2023','Sick','03 Feb 2023', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8392'
AND '02 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'02 Dec 2022','Sick','02 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8392'
AND '07 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'07 Nov 2022','Sick','15 Nov 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8392'
AND '31 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'31 Oct 2022','Sick','04 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8392'
AND '17 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'17 Oct 2022','Sick','24 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8392'
AND '10 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'10 Oct 2022','Sick','14 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8393'
AND '21 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'21 Mar 2023','Dependant Leave','21 Mar 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8393'
AND '13 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Dec 2022','Sick','14 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8393'
AND '10 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'10 Aug 2022','Sick','10 Aug 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8396'
AND '06 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Jun 2023','Sick','06 Jun 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8396'
AND '01 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'01 Jun 2023','Sick','30 Jun 2023', 0,0,1,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8396'
AND '09 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'09 May 2023','Sick','09 May 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8396'
AND '02 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'02 May 2023','Sick','05 May 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8396'
AND '17 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'17 Apr 2023','Sick','28 Apr 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8396'
AND '11 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'11 Apr 2023','Sick','13 Apr 2023', 1,0,1,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8396'
AND '30 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'30 Mar 2023','Sick','06 Apr 2023', 0,0,1,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8396'
AND '20 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'20 Mar 2023','Sick','20 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8396'
AND '08 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'08 Mar 2023','Sick','08 Mar 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8396'
AND '22 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'22 Feb 2023','Sick','03 Mar 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8396'
AND '13 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Feb 2023','Sick','14 Feb 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8396'
AND '09 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'09 Feb 2023','Sick','10 Feb 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8396'
AND '08 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'08 Feb 2023','Unpaid Leave','08 Feb 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8396'
AND '06 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Feb 2023','Sick','06 Feb 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8396'
AND '03 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Jan 2023','Sick','13 Jan 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8396'
AND '12 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'12 Dec 2022','Sick','16 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8396'
AND '23 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'23 Nov 2022','Sick','09 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8396'
AND '11 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'11 Oct 2022','Sick','11 Oct 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8396'
AND '07 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'07 Oct 2022','Sick','14 Oct 2022', 0,0,1,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8396'
AND '03 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Oct 2022','Sick','06 Oct 2022', 0,0,1,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8396'
AND '15 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 Aug 2022','Sick','15 Aug 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8396'
AND '21 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'21 Jul 2022','Sick','21 Jul 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8396'
AND '07 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'07 Jul 2022','Sick','08 Jul 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8396'
AND '06 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Jul 2022','Sick','06 Jul 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8401'
AND '13 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Jan 2023','Unpaid Leave','13 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8401'
AND '06 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Jan 2023','Sick','06 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8403'
AND '23 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'23 May 2023','Sick','23 May 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8405'
AND '08 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'08 Mar 2023','Sick','09 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8405'
AND '20 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'20 Jul 2022','Sick','20 Jul 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8408'
AND '22 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'22 May 2023','Sick','22 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8411'
AND '09 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'09 Jun 2023','Unpaid Leave','09 Jun 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8411'
AND '28 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Apr 2023','Sick','28 Apr 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8411'
AND '24 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'24 Apr 2023','Sick','24 Apr 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8411'
AND '27 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'27 Feb 2023','Sick','27 Feb 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8411'
AND '02 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'02 Feb 2023','Sick','02 Feb 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8411'
AND '14 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Nov 2022','Sick','14 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8411'
AND '11 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'11 Nov 2022','Sick','11 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8411'
AND '04 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'04 Nov 2022','Sick','04 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8411'
AND '04 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'04 Oct 2022','Sick','04 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8411'
AND '24 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'24 Aug 2022','Sick','24 Aug 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8411'
AND '14 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Jul 2022','Sick','14 Jul 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8412'
AND '17 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'17 Nov 2022','Sick','17 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8412'
AND '03 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Oct 2022','Unpaid Leave','03 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8414'
AND '12 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'12 Dec 2022','Sick','12 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8420'
AND '13 Jul 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Jul 2023','Unpaid Leave','13 Jul 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8423'
AND '17 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'17 May 2023','Dependant Leave','17 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8423'
AND '10 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'10 Oct 2022','Unpaid Leave','10 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8423'
AND '20 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'20 Sep 2022','Sick','20 Sep 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8425'
AND '16 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'16 Dec 2022','Sick','16 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8425'
AND '24 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'24 Oct 2022','Sick','04 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8425'
AND '14 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Sep 2022','Unpaid Leave','14 Sep 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8425'
AND '25 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'25 Jul 2022','Sick','26 Jul 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8430'
AND '17 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'17 Apr 2023','Sick','28 Apr 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8430'
AND '13 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Apr 2023','Sick','14 Apr 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8430'
AND '20 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'20 Mar 2023','Sick','20 Mar 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8430'
AND '06 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Mar 2023','Sick','07 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8430'
AND '11 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'11 Jan 2023','Sick','11 Jan 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8430'
AND '28 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Dec 2022','Sick','30 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8430'
AND '20 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'20 Dec 2022','Sick','23 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8430'
AND '06 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Oct 2022','Sick','07 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8433'
AND '31 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'31 Jan 2023','Sick','31 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8433'
AND '07 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'07 Dec 2022','Sick','08 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8433'
AND '15 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 Aug 2022','Sick','16 Aug 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8435'
AND '25 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'25 May 2023','Sick','26 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8435'
AND '10 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'10 Feb 2023','Sick','10 Feb 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8435'
AND '15 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 Dec 2022','Sick','16 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8437'
AND '09 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'09 Feb 2023','Dependant Leave','09 Feb 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8437'
AND '01 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'01 Feb 2023','Sick','01 Feb 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8438'
AND '09 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'09 Jan 2023','Sick','11 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8438'
AND '19 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'19 Dec 2022','Sick','21 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8438'
AND '31 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'31 Aug 2022','Sick','31 Aug 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8438'
AND '30 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'30 Aug 2022','Sick','30 Aug 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8452'
AND '07 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'07 Dec 2022','Sick','08 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8452'
AND '17 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'17 Nov 2022','Dependant Leave','18 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8454'
AND '24 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'24 Mar 2023','Sick','24 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8454'
AND '06 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Dec 2022','Dependant Leave','06 Dec 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8454'
AND '03 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Nov 2022','Sick','04 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8454'
AND '18 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'18 Jul 2022','Sick','18 Jul 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8456'
AND '29 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'29 Mar 2023','Sick','29 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8456'
AND '01 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'01 Mar 2023','Sick','01 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8456'
AND '07 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'07 Nov 2022','Sick','07 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8456'
AND '18 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'18 Oct 2022','Sick','18 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8457'
AND '30 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'30 Jan 2023','Sick','30 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8457'
AND '02 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'02 Jan 2023','Unpaid Leave','13 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8457'
AND '11 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'11 Jul 2022','Sick','13 Jul 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8458'
AND '31 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'31 May 2023','Sick','31 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8458'
AND '14 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Dec 2022','Sick','14 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8458'
AND '17 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'17 Oct 2022','Sick','17 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8458'
AND '11 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'11 Oct 2022','Sick','14 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8458'
AND '31 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'31 Aug 2022','Sick','02 Sep 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8460'
AND '13 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Oct 2022','Sick','13 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8462'
AND '26 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'26 May 2023','Sick','26 May 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8462'
AND '03 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Feb 2023','Sick','03 Feb 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8462'
AND '26 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'26 Sep 2022','Unpaid Leave','05 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8470'
AND '20 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'20 Feb 2023','Sick','20 Feb 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8470'
AND '01 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'01 Aug 2022','Sick','01 Aug 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8475'
AND '21 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'21 Nov 2022','Sick','23 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8481'
AND '07 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'07 Jul 2022','Sick','08 Jul 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8481'
AND '06 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Jul 2022','Sick','06 Jul 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8483'
AND '23 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'23 Feb 2023','Sick','17 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8485'
AND '16 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'16 Jan 2023','Sick','18 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8485'
AND '11 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'11 Jan 2023','Sick','13 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8486'
AND '28 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Jun 2023','Sick','29 Jun 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8486'
AND '28 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Mar 2023','Sick','28 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8486'
AND '24 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'24 Mar 2023','Sick','24 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8486'
AND '20 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'20 Mar 2023','Sick','22 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8486'
AND '30 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'30 Jan 2023','Sick','30 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8486'
AND '01 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'01 Nov 2022','Sick','04 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8486'
AND '21 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'21 Jul 2022','Sick','22 Jul 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8487'
AND '04 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'04 Jan 2023','Sick','06 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8487'
AND '20 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'20 Oct 2022','Sick','21 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8491'
AND '20 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'20 Apr 2023','Sick','20 Apr 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8491'
AND '01 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'01 Mar 2023','Unpaid Leave','02 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8491'
AND '11 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'11 Jan 2023','Sick','11 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8491'
AND '13 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Oct 2022','Sick','14 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8491'
AND '18 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'18 Jul 2022','Sick','22 Jul 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8491'
AND '15 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 Jul 2022','Sick','15 Jul 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8493'
AND '30 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'30 Jan 2023','Sick','30 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8493'
AND '13 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Oct 2022','Sick','14 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8493'
AND '24 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'24 Aug 2022','Sick','24 Aug 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8494'
AND '04 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'04 Jan 2023','Sick','06 Jan 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8494'
AND '18 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'18 Oct 2022','Sick','19 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8496'
AND '11 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'11 Apr 2023','Sick','12 Apr 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8496'
AND '15 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 Dec 2022','Sick','19 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8496'
AND '14 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Sep 2022','Sick','14 Sep 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8496'
AND '20 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'20 Jul 2022','Sick','20 Jul 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8497'
AND '20 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'20 Feb 2023','Sick','20 Feb 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8498'
AND '04 Jul 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'04 Jul 2023','Sick','10 Jul 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8498'
AND '15 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 May 2023','Sick','16 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8498'
AND '24 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'24 Feb 2023','Unpaid Leave','24 Feb 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8498'
AND '03 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Jan 2023','Sick','03 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8498'
AND '20 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'20 Oct 2022','Sick','21 Oct 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8499'
AND '18 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'18 Aug 2022','Sick','30 Mar 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8500'
AND '15 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 Dec 2022','Sick','16 Dec 2022', 0,0,1,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8502'
AND '03 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Jan 2023','Sick','11 Jan 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8502'
AND '28 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Dec 2022','Sick','28 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8502'
AND '22 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'22 Dec 2022','Sick','23 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8502'
AND '06 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Dec 2022','Sick','19 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8502'
AND '01 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'01 Dec 2022','Sick','01 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8502'
AND '10 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'10 Nov 2022','Sick','10 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8502'
AND '03 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Nov 2022','Sick','03 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8509'
AND '23 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'23 Mar 2023','Sick','31 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8509'
AND '14 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Feb 2023','Sick','16 Feb 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8509'
AND '24 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'24 Oct 2022','Sick','28 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8515'
AND '29 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'29 Mar 2023','Sick','30 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8515'
AND '29 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'29 Nov 2022','Sick','01 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8517'
AND '24 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'24 May 2023','Sick','24 May 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8517'
AND '03 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Apr 2023','Sick','03 Apr 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8517'
AND '09 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'09 Jan 2023','Sick','20 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8517'
AND '19 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'19 Dec 2022','Sick','23 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8518'
AND '26 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'26 Jul 2022','Sick','27 Jul 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8519'
AND '16 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'16 Nov 2022','Sick','15 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8519'
AND '04 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'04 Oct 2022','Sick','07 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8519'
AND '08 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'08 Aug 2022','Sick','09 Aug 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8519'
AND '11 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'11 Jul 2022','Sick','15 Jul 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8520'
AND '12 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'12 Jan 2023','Sick','09 Feb 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8520'
AND '09 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'09 Jan 2023','Sick','09 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8520'
AND '24 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'24 Nov 2022','Sick','30 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8520'
AND '28 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Oct 2022','Sick','28 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8520'
AND '11 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'11 Jul 2022','Sick','11 Jul 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8521'
AND '15 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 May 2023','Sick','15 May 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8521'
AND '17 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'17 Feb 2023','Sick','20 Feb 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8521'
AND '11 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'11 Jan 2023','Sick','11 Jan 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8521'
AND '15 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 Sep 2022','Sick','15 Sep 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8521'
AND '12 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'12 Jul 2022','Sick','13 Jul 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8523'
AND '08 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'08 Mar 2023','Sick','10 Mar 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8523'
AND '20 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'20 Dec 2022','Sick','23 Dec 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8523'
AND '18 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'18 Oct 2022','Sick','21 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8523'
AND '26 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'26 Aug 2022','Compassionate Leave','26 Aug 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8526'
AND '03 Jul 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Jul 2023','Sick','05 Jul 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8526'
AND '30 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'30 Jan 2023','Sick','31 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8529'
AND '10 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'10 May 2023','Sick','10 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8529'
AND '23 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'23 Nov 2022','Sick','23 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8530'
AND '03 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Aug 2022','Sick','05 Aug 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8531'
AND '16 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'16 May 2023','Sick','19 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8531'
AND '19 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'19 Dec 2022','Sick','21 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8531'
AND '22 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'22 Nov 2022','Sick','22 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8531'
AND '24 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'24 Aug 2022','Compassionate Leave','24 Aug 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8532'
AND '07 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'07 Mar 2023','Sick','08 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8532'
AND '15 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 Dec 2022','Sick','16 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8532'
AND '10 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'10 Oct 2022','Sick','10 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8532'
AND '07 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'07 Oct 2022','Sick','07 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8532'
AND '05 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'05 Sep 2022','Sick','05 Sep 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8533'
AND '03 Jul 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Jul 2023','Sick','03 Jul 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8533'
AND '09 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'09 Jan 2023','Sick','09 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8533'
AND '12 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'12 Dec 2022','Sick','13 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8533'
AND '12 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'12 Oct 2022','Compassionate Leave','12 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8533'
AND '21 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'21 Sep 2022','Sick','23 Sep 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8536'
AND '03 Jul 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Jul 2023','Sick','04 Jul 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8536'
AND '06 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Jun 2023','Sick','07 Jun 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8536'
AND '04 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'04 Apr 2023','Sick','04 Apr 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8536'
AND '12 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'12 Sep 2022','Sick','14 Sep 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8537'
AND '18 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'18 Oct 2022','Sick','19 Oct 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8541'
AND '02 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'02 Jan 2023','Unpaid Leave','06 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8541'
AND '28 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Dec 2022','Sick','30 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8549'
AND '10 Jul 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'10 Jul 2023','Unpaid Leave','10 Jul 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8549'
AND '05 Jul 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'05 Jul 2023','Unpaid Leave','06 Jul 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8549'
AND '03 Jul 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Jul 2023','Dependant Leave','03 Jul 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8549'
AND '24 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'24 Feb 2023','Dependant Leave','24 Feb 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8549'
AND '10 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'10 Feb 2023','Dependant Leave','10 Feb 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8549'
AND '23 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'23 Sep 2022','Dependant Leave','23 Sep 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8549'
AND '30 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'30 Aug 2022','Dependant Leave','30 Aug 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8550'
AND '08 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'08 Jul 2022','Sick','08 Jul 2022', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8550'
AND '06 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Jul 2022','Sick','06 Jul 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8551'
AND '12 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'12 Apr 2023','Sick','12 Apr 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8551'
AND '13 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Mar 2023','Sick','13 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8551'
AND '12 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'12 Oct 2022','Sick','14 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8551'
AND '08 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'08 Sep 2022','Sick','09 Sep 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8554'
AND '15 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 Aug 2022','Unpaid Leave','26 Aug 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8555'
AND '04 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'04 Nov 2022','Sick','04 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8556'
AND '05 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'05 Dec 2022','Sick','08 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8560'
AND '11 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'11 Jul 2022','Sick','15 Jul 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8561'
AND '07 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'07 Oct 2022','Sick','07 Oct 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8561'
AND '06 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Oct 2022','Sick','06 Oct 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8562'
AND '17 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'17 Apr 2023','Sick','17 Apr 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8562'
AND '13 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Mar 2023','Sick','13 Mar 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8562'
AND '24 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'24 Jan 2023','Sick','25 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8565'
AND '18 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'18 May 2023','Sick','18 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8565'
AND '28 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Mar 2023','Sick','31 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8565'
AND '30 Jun 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'30 Jun 2022','Sick','01 Jul 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8567'
AND '05 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'05 Apr 2023','Sick','06 Apr 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8567'
AND '27 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'27 Mar 2023','Sick','27 Mar 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8567'
AND '20 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'20 Jan 2023','Sick','20 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8567'
AND '14 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Dec 2022','Sick','16 Dec 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8567'
AND '12 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'12 Dec 2022','Sick','12 Dec 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8567'
AND '28 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Nov 2022','Sick','28 Nov 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8567'
AND '02 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'02 Nov 2022','Sick','03 Nov 2022', 0,0,1,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8567'
AND '31 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'31 Oct 2022','Sick','01 Nov 2022', 0,0,1,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8567'
AND '13 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Oct 2022','Sick','13 Oct 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8573'
AND '19 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'19 Oct 2022','Sick','21 Oct 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8574'
AND '07 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'07 Jun 2023','Unpaid Leave','07 Jun 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8574'
AND '26 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'26 May 2023','Sick','26 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8575'
AND '18 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'18 May 2023','Sick','18 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8575'
AND '16 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'16 Jan 2023','Sick','20 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8575'
AND '03 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Jan 2023','Sick','13 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8575'
AND '29 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'29 Nov 2022','Sick','29 Nov 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8576'
AND '05 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'05 Jun 2023','Sick','06 Jun 2023', 0,0,1,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8576'
AND '15 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 May 2023','Sick','17 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8576'
AND '04 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'04 Jul 2022','Sick','05 Jul 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8578'
AND '29 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'29 Jun 2023','Sick','29 Jun 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8578'
AND '28 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Jun 2023','Sick','28 Jun 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8578'
AND '17 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'17 Mar 2023','Sick','17 Mar 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8578'
AND '23 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'23 Jan 2023','Sick','23 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8578'
AND '16 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'16 Dec 2022','Sick','16 Dec 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8578'
AND '27 Jun 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'27 Jun 2022','Sick','01 Jul 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8582'
AND '12 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'12 Dec 2022','Sick','28 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8582'
AND '06 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Dec 2022','Sick','06 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8582'
AND '19 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'19 Aug 2022','Unpaid Leave','19 Aug 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8582'
AND '19 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'19 Jul 2022','Compassionate Leave','19 Jul 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8585'
AND '23 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'23 Jun 2023','Sick','23 Jun 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8585'
AND '15 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 Jul 2022','Sick','15 Jul 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8586'
AND '05 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'05 May 2023','Sick','05 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8586'
AND '02 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'02 May 2023','Sick','02 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8586'
AND '13 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Feb 2023','Sick','13 Feb 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8586'
AND '23 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'23 Jan 2023','Sick','23 Jan 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8586'
AND '07 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'07 Nov 2022','Sick','08 Nov 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8586'
AND '05 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'05 Oct 2022','Sick','05 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8586'
AND '15 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 Aug 2022','Sick','19 Aug 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8589'
AND '22 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'22 Dec 2022','Sick','22 Dec 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8589'
AND '25 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'25 Oct 2022','Sick','28 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8590'
AND '11 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'11 Jan 2023','Sick','11 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8590'
AND '14 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Nov 2022','Sick','14 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8590'
AND '25 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'25 Aug 2022','Sick','25 Aug 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8594'
AND '17 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'17 Oct 2022','Sick','21 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8596'
AND '12 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'12 Oct 2022','Sick','13 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8598'
AND '01 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'01 Dec 2022','Sick','01 Dec 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8598'
AND '30 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'30 Nov 2022','Sick','30 Nov 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8598'
AND '29 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'29 Nov 2022','Sick','29 Nov 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8598'
AND '28 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Nov 2022','Sick','28 Nov 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8602'
AND '21 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'21 Jul 2022','Sick','21 Jul 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8602'
AND '19 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'19 Jul 2022','Sick','19 Jul 2022', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8603'
AND '02 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'02 Mar 2023','Sick','02 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8603'
AND '20 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'20 Feb 2023','Sick','22 Feb 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8611'
AND '09 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'09 Jan 2023','Sick','10 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8611'
AND '15 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 Dec 2022','Sick','16 Dec 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8613'
AND '21 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'21 Jun 2023','Sick','21 Jun 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8613'
AND '12 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'12 Jun 2023','Sick','12 Jun 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8613'
AND '02 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'02 Mar 2023','Sick','02 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8613'
AND '06 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Dec 2022','Sick','06 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8613'
AND '18 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'18 Jul 2022','Parental','18 Jul 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8614'
AND '27 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'27 Oct 2022','Unpaid Leave','28 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8618'
AND '25 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'25 Jul 2022','Sick','19 Aug 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8618'
AND '29 Jun 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'29 Jun 2022','Sick','22 Jul 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8622'
AND '05 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'05 May 2023','Sick','05 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8622'
AND '10 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'10 Mar 2023','Sick','10 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8622'
AND '23 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'23 Jan 2023','Sick','23 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8622'
AND '31 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'31 Aug 2022','Sick','31 Aug 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8622'
AND '04 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'04 Jul 2022','Sick','04 Jul 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8623'
AND '03 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 May 2023','Sick','04 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8623'
AND '01 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'01 Mar 2023','Sick','01 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8625'
AND '14 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Feb 2023','Sick','17 Feb 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8626'
AND '11 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'11 Jan 2023','Sick','12 Jan 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8626'
AND '28 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Dec 2022','Sick','30 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8626'
AND '01 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'01 Dec 2022','Sick','25 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8626'
AND '22 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'22 Nov 2022','Sick','25 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8626'
AND '16 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'16 Nov 2022','Sick','16 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8626'
AND '28 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Jul 2022','Sick','29 Jul 2022', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8626'
AND '27 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'27 Jul 2022','Sick','27 Jul 2022', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8630'
AND '13 Jul 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Jul 2023','Sick','13 Jul 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8630'
AND '30 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'30 Mar 2023','Sick','30 Mar 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8630'
AND '21 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'21 Dec 2022','Dependant Leave','22 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8630'
AND '01 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'01 Dec 2022','Dependant Leave','01 Dec 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8630'
AND '03 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Oct 2022','Sick','04 Oct 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8630'
AND '31 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'31 Aug 2022','Dependant Leave','31 Aug 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8634'
AND '23 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'23 Nov 2022','Sick','30 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8637'
AND '17 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'17 May 2023','Sick','17 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8637'
AND '07 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'07 Mar 2023','Sick','07 Mar 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8637'
AND '09 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'09 Dec 2022','Sick','09 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8637'
AND '06 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Dec 2022','Sick','08 Dec 2022', 0,0,1,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8640'
AND '05 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'05 May 2023','Sick','05 May 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8640'
AND '20 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'20 Mar 2023','Sick','23 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8640'
AND '06 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Mar 2023','Sick','17 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8640'
AND '25 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'25 Nov 2022','Sick','25 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8640'
AND '14 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Nov 2022','Sick','15 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8640'
AND '27 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'27 Oct 2022','Sick','27 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8640'
AND '26 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'26 Sep 2022','Sick','30 Sep 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8640'
AND '20 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'20 Sep 2022','Sick','23 Sep 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8640'
AND '15 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 Sep 2022','Sick','16 Sep 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8640'
AND '15 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 Aug 2022','Sick','12 Sep 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8640'
AND '02 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'02 Aug 2022','Sick','12 Aug 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8640'
AND '11 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'11 Jul 2022','Sick','15 Jul 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8641'
AND '29 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'29 Sep 2022','Sick','29 Sep 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8641'
AND '22 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'22 Sep 2022','Sick','22 Sep 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8642'
AND '15 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 May 2023','Sick','15 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8642'
AND '11 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'11 May 2023','Sick','12 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8643'
AND '05 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'05 May 2023','Sick','05 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8643'
AND '29 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'29 Sep 2022','Sick','29 Sep 2022', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8645'
AND '19 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'19 Apr 2023','Sick','19 Apr 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8645'
AND '23 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'23 Feb 2023','Sick','24 Feb 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8645'
AND '17 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'17 Feb 2023','Sick','21 Feb 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8645'
AND '29 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'29 Nov 2022','Sick','30 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8645'
AND '27 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'27 Sep 2022','Sick','30 Sep 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8645'
AND '19 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'19 Aug 2022','Compassionate Leave','23 Aug 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8645'
AND '08 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'08 Jul 2022','Sick','08 Jul 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8646'
AND '14 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Nov 2022','Sick','18 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8646'
AND '09 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'09 Nov 2022','Sick','11 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8649'
AND '15 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 Dec 2022','Sick','16 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8650'
AND '21 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'21 Apr 2023','Sick','21 Apr 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8650'
AND '27 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'27 Mar 2023','Sick','27 Mar 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8650'
AND '06 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Feb 2023','Sick','06 Feb 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8658'
AND '22 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'22 Aug 2022','Unpaid Leave','26 Aug 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8659'
AND '02 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'02 May 2023','Sick','05 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8659'
AND '28 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Oct 2022','Sick','28 Oct 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8659'
AND '10 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'10 Oct 2022','Sick','12 Oct 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8659'
AND '15 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 Sep 2022','Sick','15 Sep 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8659'
AND '02 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'02 Sep 2022','Sick','02 Sep 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8664'
AND '27 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'27 Mar 2023','Sick','31 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8665'
AND '30 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'30 Jun 2023','Sick','30 Jun 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8665'
AND '28 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Jun 2023','Sick','28 Jun 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8669'
AND '11 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'11 Aug 2022','Unpaid Leave','11 Aug 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8671'
AND '06 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Jan 2023','Sick','06 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8677'
AND '23 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'23 Jun 2023','Sick','23 Jun 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8677'
AND '22 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'22 May 2023','Sick','23 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8677'
AND '13 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Oct 2022','Sick','14 Oct 2022', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8678'
AND '07 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'07 Feb 2023','Dependant Leave','07 Feb 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8678'
AND '30 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'30 Nov 2022','Sick','06 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8678'
AND '22 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'22 Nov 2022','Sick','24 Nov 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8679'
AND '04 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'04 Jan 2023','Sick','11 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8679'
AND '13 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Dec 2022','Sick','23 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8679'
AND '08 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'08 Dec 2022','Sick','09 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8679'
AND '14 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Nov 2022','Sick','14 Nov 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8679'
AND '11 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'11 Nov 2022','Sick','11 Nov 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8679'
AND '04 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'04 Nov 2022','Sick','04 Nov 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8682'
AND '24 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'24 Nov 2022','Dependant Leave','24 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8684'
AND '06 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Mar 2023','Sick','07 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8687'
AND '14 Jul 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Jul 2023','Sick','14 Jul 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8687'
AND '05 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'05 Jun 2023','Sick','05 Jun 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8687'
AND '03 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Mar 2023','Sick','03 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8687'
AND '06 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Feb 2023','Sick','06 Feb 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8687'
AND '10 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'10 Oct 2022','Sick','10 Oct 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8689'
AND '14 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Dec 2022','Sick','15 Dec 2022', 1,0,1,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8689'
AND '24 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'24 Oct 2022','Sick','28 Oct 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8689'
AND '10 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'10 Oct 2022','Sick','11 Oct 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8689'
AND '22 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'22 Aug 2022','Sick','26 Aug 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8689'
AND '05 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'05 Aug 2022','Sick','05 Aug 2022', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8689'
AND '20 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'20 Jul 2022','Unpaid Leave','20 Jul 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8689'
AND '13 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Jul 2022','Compassionate Leave','15 Jul 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8690'
AND '09 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'09 May 2023','Sick','12 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8690'
AND '02 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'02 May 2023','Sick','05 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8690'
AND '24 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'24 Apr 2023','Sick','28 Apr 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8690'
AND '04 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'04 Apr 2023','Sick','04 Apr 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8690'
AND '14 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Nov 2022','Sick','14 Nov 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8691'
AND '28 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Dec 2022','Sick','28 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8691'
AND '28 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Nov 2022','Sick','02 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8692'
AND '15 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 Dec 2022','Sick','16 Dec 2022', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8693'
AND '06 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Apr 2023','Sick','06 Apr 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8693'
AND '05 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'05 Dec 2022','Sick','05 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8693'
AND '28 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Nov 2022','Sick','28 Nov 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8693'
AND '14 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Nov 2022','Unpaid Leave','18 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8694'
AND '09 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'09 Feb 2023','Sick','10 Feb 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8694'
AND '12 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'12 Dec 2022','Sick','15 Dec 2022', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8694'
AND '05 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'05 Oct 2022','Sick','05 Oct 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8696'
AND '16 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'16 Dec 2022','Sick','16 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8702'
AND '29 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'29 Nov 2022','Sick','29 Nov 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8703'
AND '14 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Dec 2022','Sick','15 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8703'
AND '01 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'01 Dec 2022','Sick','01 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8703'
AND '25 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'25 Nov 2022','Unpaid Leave','25 Nov 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8703'
AND '16 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'16 Nov 2022','Sick','16 Nov 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8703'
AND '12 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'12 Oct 2022','Sick','12 Oct 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8703'
AND '13 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Sep 2022','Sick','13 Sep 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8704'
AND '11 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'11 Apr 2023','Sick','14 Apr 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8704'
AND '06 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Feb 2023','Sick','07 Feb 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8706'
AND '10 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'10 Mar 2023','Sick','10 Mar 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8707'
AND '25 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'25 Apr 2023','Sick','25 Apr 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8707'
AND '28 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Feb 2023','Unpaid Leave','28 Feb 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8708'
AND '20 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'20 Jan 2023','Sick','20 Jan 2023', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8708'
AND '14 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Oct 2022','Sick','14 Oct 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8709'
AND '12 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'12 Jun 2023','Sick','13 Jun 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8709'
AND '11 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'11 May 2023','Sick','12 May 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8709'
AND '07 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'07 Mar 2023','Sick','07 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8714'
AND '15 Aug 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 Aug 2022','Unpaid Leave','15 Aug 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8715'
AND '10 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'10 Jan 2023','Sick','11 Jan 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8715'
AND '25 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'25 Oct 2022','Sick','26 Oct 2022', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8718'
AND '07 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'07 Mar 2023','Sick','07 Mar 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8718'
AND '05 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'05 Sep 2022','Compassionate Leave','05 Sep 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8721'
AND '18 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'18 Apr 2023','Sick','18 Apr 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8721'
AND '23 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'23 Nov 2022','Sick','01 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8723'
AND '13 Jul 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Jul 2023','Sick','14 Jul 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8723'
AND '12 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'12 Jun 2023','Sick','14 Jun 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8723'
AND '28 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Mar 2023','Sick','28 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8723'
AND '07 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'07 Mar 2023','Sick','07 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8723'
AND '22 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'22 Dec 2022','Sick','22 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8723'
AND '13 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Dec 2022','Sick','13 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8723'
AND '14 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Sep 2022','Sick','14 Sep 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8723'
AND '09 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'09 Sep 2022','Unpaid Leave','09 Sep 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8724'
AND '31 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'31 Mar 2023','Sick','31 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8724'
AND '06 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Feb 2023','Sick','06 Feb 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8728'
AND '09 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'09 May 2023','Sick','12 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8728'
AND '28 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Mar 2023','Sick','31 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8728'
AND '16 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'16 Feb 2023','Sick','16 Feb 2023', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8728'
AND '30 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'30 Jan 2023','Sick','30 Jan 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8728'
AND '14 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Dec 2022','Sick','16 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8729'
AND '15 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 Mar 2023','Sick','17 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8729'
AND '09 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'09 Jan 2023','Sick','20 Jan 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8729'
AND '05 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'05 Jan 2023','Sick','05 Jan 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8729'
AND '14 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Oct 2022','Sick','14 Oct 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8729'
AND '11 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'11 Oct 2022','Sick','11 Oct 2022', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8730'
AND '16 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'16 Dec 2022','Sick','23 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8730'
AND '13 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Dec 2022','Sick','13 Dec 2022', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8730'
AND '28 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Nov 2022','Sick','01 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8730'
AND '21 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'21 Nov 2022','Sick','21 Nov 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8730'
AND '14 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Nov 2022','Sick','16 Nov 2022', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8730'
AND '18 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'18 Oct 2022','Sick','19 Oct 2022', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8731'
AND '17 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'17 Mar 2023','Sick','17 Mar 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8733'
AND '06 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Mar 2023','Sick','06 Mar 2023', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8733'
AND '28 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Feb 2023','Sick','03 Mar 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8733'
AND '20 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'20 Feb 2023','Sick','22 Feb 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8733'
AND '23 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'23 Jan 2023','Sick','24 Jan 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8733'
AND '13 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Jan 2023','Sick','13 Jan 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8733'
AND '10 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'10 Jan 2023','Unpaid Leave','10 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8733'
AND '23 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'23 Nov 2022','Sick','24 Nov 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8735'
AND '20 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'20 Dec 2022','Sick','20 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8736'
AND '13 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Mar 2023','Sick','13 Mar 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8736'
AND '27 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'27 Feb 2023','Sick','27 Feb 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8736'
AND '15 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 Dec 2022','Sick','16 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8736'
AND '06 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Dec 2022','Sick','06 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8736'
AND '23 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'23 Nov 2022','Sick','23 Nov 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8736'
AND '13 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Oct 2022','Sick','01 Nov 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8736'
AND '10 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'10 Oct 2022','Sick','12 Oct 2022', 1,0,1,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8736'
AND '26 Sep 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'26 Sep 2022','Sick','26 Sep 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8737'
AND '25 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'25 Jan 2023','Sick','25 Jan 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8737'
AND '09 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'09 Nov 2022','Sick','10 Nov 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8737'
AND '19 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'19 Oct 2022','Sick','20 Oct 2022', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8738'
AND '03 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Oct 2022','Sick','03 Oct 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8739'
AND '15 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 Dec 2022','Sick','16 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8739'
AND '05 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'05 Dec 2022','Sick','07 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8739'
AND '25 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'25 Oct 2022','Sick','25 Oct 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8741'
AND '27 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'27 Apr 2023','Sick','27 Apr 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8741'
AND '09 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'09 Jan 2023','Sick','11 Jan 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8741'
AND '05 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'05 Jan 2023','Sick','05 Jan 2023', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8741'
AND '28 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Dec 2022','Sick','28 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8741'
AND '08 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'08 Dec 2022','Sick','08 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8742'
AND '16 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'16 Jun 2023','Sick','16 Jun 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8742'
AND '27 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'27 Mar 2023','Sick','27 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8742'
AND '24 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'24 Mar 2023','Sick','24 Mar 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8742'
AND '10 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'10 Oct 2022','Sick','12 Oct 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8743'
AND '27 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'27 Feb 2023','Sick','27 Feb 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8743'
AND '03 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Feb 2023','Sick','03 Feb 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8746'
AND '28 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Dec 2022','Unpaid Leave','28 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8747'
AND '02 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'02 Dec 2022','Sick','02 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8747'
AND '30 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'30 Nov 2022','Sick','30 Nov 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8748'
AND '14 Jul 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Jul 2023','Unpaid Leave','14 Jul 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8750'
AND '28 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Dec 2022','Sick','30 Dec 2022', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8751'
AND '29 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'29 Dec 2022','Unpaid Leave','30 Dec 2022', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8751'
AND '13 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Dec 2022','Sick','13 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8751'
AND '30 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'30 Nov 2022','Sick','01 Dec 2022', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8751'
AND '14 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Nov 2022','Sick','14 Nov 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8752'
AND '05 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'05 Jun 2023','Sick','05 Jun 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8752'
AND '06 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Apr 2023','Sick','06 Apr 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8752'
AND '09 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'09 Jan 2023','Sick','09 Jan 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8752'
AND '06 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Jan 2023','Sick','06 Jan 2023', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8752'
AND '25 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'25 Oct 2022','Sick','25 Oct 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8754'
AND '02 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'02 Mar 2023','Sick','02 Mar 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8754'
AND '28 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Feb 2023','Sick','28 Feb 2023', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8756'
AND '07 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'07 Nov 2022','Sick','07 Nov 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8757'
AND '14 Jul 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Jul 2023','Sick','14 Jul 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8757'
AND '27 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'27 Feb 2023','Sick','28 Feb 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8762'
AND '04 Jul 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'04 Jul 2023','Sick','17 Jul 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8762'
AND '05 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'05 Jun 2023','Sick','06 Jun 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8762'
AND '31 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'31 May 2023','Sick','31 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8762'
AND '28 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Mar 2023','Sick','29 Mar 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8762'
AND '06 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Feb 2023','Sick','06 Feb 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8762'
AND '05 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'05 Dec 2022','Sick','05 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8763'
AND '06 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Jan 2023','Sick','06 Jan 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8763'
AND '04 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'04 Jan 2023','Sick','04 Jan 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8764'
AND '28 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Dec 2022','Sick','29 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8764'
AND '19 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'19 Dec 2022','Sick','23 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8764'
AND '24 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'24 Oct 2022','Sick','25 Oct 2022', 1,0,1,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8765'
AND '13 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Feb 2023','Sick','13 Feb 2023', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8765'
AND '08 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'08 Feb 2023','Sick','09 Feb 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8765'
AND '31 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'31 Oct 2022','Sick','01 Nov 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8766'
AND '16 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'16 Jun 2023','Sick','16 Jun 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8766'
AND '17 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'17 Feb 2023','Dependant Leave','17 Feb 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8766'
AND '25 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'25 Jan 2023','Sick','25 Jan 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8766'
AND '16 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'16 Dec 2022','Sick','16 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8766'
AND '06 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Dec 2022','Sick','07 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8767'
AND '27 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'27 Feb 2023','Sick','02 Mar 2023', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8767'
AND '01 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'01 Dec 2022','Sick','02 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8767'
AND '29 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'29 Nov 2022','Sick','30 Nov 2022', 1,0,1,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8767'
AND '31 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'31 Oct 2022','Sick','02 Nov 2022', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8768'
AND '05 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'05 Dec 2022','Sick','31 Jan 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8768'
AND '28 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Nov 2022','Sick','30 Nov 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8768'
AND '24 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'24 Nov 2022','Sick','25 Nov 2022', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8768'
AND '16 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'16 Nov 2022','Sick','18 Nov 2022', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8768'
AND '07 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'07 Nov 2022','Dependant Leave','07 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8768'
AND '02 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'02 Nov 2022','Sick','04 Nov 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8769'
AND '04 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'04 May 2023','Sick','04 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8769'
AND '09 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'09 Mar 2023','Sick','10 Mar 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8769'
AND '26 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'26 Jan 2023','Sick','26 Jan 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8770'
AND '28 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Nov 2022','Sick','30 Nov 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8771'
AND '06 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Dec 2022','Sick','09 Dec 2022', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8774'
AND '04 Jul 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'04 Jul 2023','Sick','05 Jul 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8774'
AND '29 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'29 Nov 2022','Sick','30 Nov 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8776'
AND '21 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'21 Feb 2023','Sick','21 Feb 2023', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8776'
AND '28 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Dec 2022','Sick','30 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8776'
AND '14 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Dec 2022','Sick','23 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8778'
AND '10 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'10 Jan 2023','Sick','10 Jan 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8779'
AND '19 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'19 Dec 2022','Unpaid Leave','19 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8782'
AND '08 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'08 Dec 2022','Sick','08 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8785'
AND '15 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 May 2023','Dependant Leave','15 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8789'
AND '20 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'20 Mar 2023','Sick','20 Mar 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8792'
AND '13 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Mar 2023','Sick','20 Mar 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8792'
AND '07 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'07 Feb 2023','Sick','03 Mar 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8793'
AND '25 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'25 Jan 2023','Sick','27 Jan 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8794'
AND '30 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'30 Jan 2023','Unpaid Leave','30 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8794'
AND '19 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'19 Jan 2023','Sick','20 Jan 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8794'
AND '14 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Nov 2022','Sick','14 Nov 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8795'
AND '10 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'10 Feb 2023','Sick','10 Feb 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8795'
AND '06 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Feb 2023','Sick','09 Feb 2023', 1,0,1,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8795'
AND '23 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'23 Jan 2023','Sick','23 Jan 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8796'
AND '07 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'07 Mar 2023','Sick','09 Mar 2023', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8798'
AND '24 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'24 Jan 2023','Sick','25 Jan 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8798'
AND '15 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 Dec 2022','Sick','15 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8800'
AND '10 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'10 Jan 2023','Unpaid Leave','11 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8800'
AND '03 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Jan 2023','Sick','03 Jan 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8801'
AND '04 Jul 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'04 Jul 2023','Sick','05 Jul 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8801'
AND '15 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 Jun 2023','Sick','15 Jun 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8801'
AND '02 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'02 May 2023','Sick','02 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8801'
AND '28 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Feb 2023','Sick','28 Feb 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8801'
AND '09 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'09 Jan 2023','Sick','13 Jan 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8801'
AND '07 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'07 Dec 2022','Sick','08 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8802'
AND '13 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Jun 2023','Sick','13 Jun 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8802'
AND '18 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'18 Apr 2023','Sick','28 Apr 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8802'
AND '06 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Mar 2023','Sick','06 Mar 2023', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8803'
AND '27 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'27 Jun 2023','Sick','07 Jul 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8803'
AND '23 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'23 Jun 2023','Sick','23 Jun 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8803'
AND '19 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'19 May 2023','Sick','19 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8803'
AND '23 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'23 Mar 2023','Sick','04 Apr 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8803'
AND '10 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'10 Mar 2023','Sick','10 Mar 2023', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8803'
AND '03 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Mar 2023','Sick','03 Mar 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8803'
AND '27 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'27 Feb 2023','Sick','27 Feb 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8803'
AND '15 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 Feb 2023','Sick','15 Feb 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8803'
AND '09 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'09 Jan 2023','Sick','10 Jan 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8804'
AND '23 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'23 Mar 2023','Sick','24 Mar 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8804'
AND '25 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'25 Jan 2023','Sick','25 Jan 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8804'
AND '13 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Dec 2022','Sick','13 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8805'
AND '20 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'20 Dec 2022','Sick','20 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8805'
AND '12 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'12 Dec 2022','Sick','12 Dec 2022', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8806'
AND '03 Jul 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Jul 2023','Sick','03 Jul 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8806'
AND '18 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'18 May 2023','Sick','18 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8806'
AND '07 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'07 Mar 2023','Sick','10 Mar 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8806'
AND '21 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'21 Feb 2023','Sick','24 Feb 2023', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8806'
AND '14 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Feb 2023','Sick','15 Feb 2023', 1,0,1,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8806'
AND '02 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'02 Feb 2023','Sick','02 Feb 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8806'
AND '01 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'01 Dec 2022','Sick','01 Dec 2022', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8807'
AND '13 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Jun 2023','Sick','13 Jun 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8808'
AND '08 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'08 Dec 2022','Sick','09 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8809'
AND '26 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'26 Apr 2023','Sick','26 Apr 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8809'
AND '14 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Mar 2023','Sick','14 Mar 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8810'
AND '17 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'17 Nov 2022','Sick','02 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8811'
AND '11 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'11 May 2023','Sick','12 May 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8812'
AND '06 Jul 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Jul 2023','Dependant Leave','06 Jul 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8812'
AND '21 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'21 Feb 2023','Sick','21 Feb 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8813'
AND '03 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Jan 2023','Sick','10 Jan 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8815'
AND '03 Jul 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Jul 2023','Sick','03 Jul 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8815'
AND '04 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'04 Apr 2023','Sick','05 Apr 2023', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8817'
AND '19 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'19 Dec 2022','Sick','23 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8817'
AND '09 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'09 Dec 2022','Sick','09 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8819'
AND '11 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'11 May 2023','Unpaid Leave','12 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8819'
AND '26 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'26 Jan 2023','Sick','27 Jan 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8819'
AND '05 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'05 Dec 2022','Sick','06 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8821'
AND '01 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'01 Feb 2023','Sick','01 Feb 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8821'
AND '23 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'23 Jan 2023','Sick','23 Jan 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8821'
AND '09 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'09 Dec 2022','Sick','09 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8822'
AND '11 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'11 Jan 2023','Sick','11 Jan 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8822'
AND '04 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'04 Jan 2023','Sick','06 Jan 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8822'
AND '22 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'22 Dec 2022','Sick','22 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8824'
AND '27 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'27 Feb 2023','Sick','26 Mar 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8824'
AND '09 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'09 Jan 2023','Sick','11 Jan 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8826'
AND '15 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 May 2023','Sick','15 May 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8826'
AND '28 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Apr 2023','Sick','28 Apr 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8826'
AND '24 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'24 Mar 2023','Sick','24 Mar 2023', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8826'
AND '17 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'17 Mar 2023','Sick','17 Mar 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8826'
AND '14 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Mar 2023','Sick','14 Mar 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8826'
AND '30 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'30 Jan 2023','Sick','30 Jan 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8828'
AND '20 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'20 Mar 2023','Sick','20 Mar 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8828'
AND '13 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Mar 2023','Sick','14 Mar 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8828'
AND '13 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Jan 2023','Sick','13 Jan 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8829'
AND '21 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'21 Feb 2023','Sick','27 Feb 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8832'
AND '03 Jul 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Jul 2023','Sick','07 Jul 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8832'
AND '02 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'02 May 2023','Sick','03 May 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8832'
AND '03 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Apr 2023','Sick','03 Apr 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8832'
AND '30 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'30 Jan 2023','Sick','03 Feb 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8834'
AND '08 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'08 Jun 2023','Sick','08 Jun 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8834'
AND '09 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'09 Feb 2023','Sick','09 Feb 2023', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8834'
AND '28 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Dec 2022','Unpaid Leave','30 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8834'
AND '19 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'19 Dec 2022','Unpaid Leave','23 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8834'
AND '15 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 Dec 2022','Sick','15 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8836'
AND '06 Jul 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Jul 2023','Sick','06 Jul 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8836'
AND '15 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 May 2023','Sick','19 May 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8836'
AND '09 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'09 May 2023','Sick','12 May 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8836'
AND '03 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 May 2023','Sick','05 May 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8836'
AND '11 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'11 Apr 2023','Sick','11 Apr 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8836'
AND '15 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 Feb 2023','Sick','20 Feb 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8837'
AND '26 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'26 Jun 2023','Sick','26 Jun 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8837'
AND '06 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Jun 2023','Sick','06 Jun 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8837'
AND '15 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 May 2023','Sick','15 May 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8837'
AND '14 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Apr 2023','Sick','14 Apr 2023', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8837'
AND '11 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'11 Apr 2023','Sick','11 Apr 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8837'
AND '05 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'05 Apr 2023','Sick','05 Apr 2023', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8837'
AND '23 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'23 Feb 2023','Sick','24 Feb 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8838'
AND '17 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'17 May 2023','Sick','17 May 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8839'
AND '16 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'16 Dec 2022','Sick','19 Dec 2022', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8842'
AND '16 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'16 Mar 2023','Sick','16 Mar 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8843'
AND '23 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'23 Jun 2023','Sick','23 Jun 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8844'
AND '18 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'18 May 2023','Dependant Leave','19 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8845'
AND '20 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'20 Mar 2023','Sick','20 Mar 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8847'
AND '21 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'21 Feb 2023','Sick','22 Feb 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8847'
AND '15 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 Feb 2023','Sick','17 Feb 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8847'
AND '25 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'25 Jan 2023','Sick','27 Jan 2023', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8847'
AND '24 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'24 Jan 2023','Sick','24 Jan 2023', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8847'
AND '03 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Jan 2023','Sick','03 Jan 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8851'
AND '12 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'12 Jun 2023','Sick','12 Jun 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8851'
AND '10 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'10 May 2023','Sick','10 May 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8851'
AND '01 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'01 Mar 2023','Sick','03 Mar 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8851'
AND '16 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'16 Feb 2023','Sick','16 Feb 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8853'
AND '18 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'18 Jan 2023','Dependant Leave','18 Jan 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8854'
AND '03 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Mar 2023','Sick','09 Mar 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8857'
AND '06 Jul 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Jul 2023','Sick','06 Jul 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8857'
AND '22 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'22 May 2023','Sick','22 May 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8857'
AND '13 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Feb 2023','Sick','15 Feb 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8857'
AND '30 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'30 Jan 2023','Sick','31 Jan 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8857'
AND '16 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'16 Jan 2023','Sick','17 Jan 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8861'
AND '17 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'17 Apr 2023','Sick','17 Apr 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8861'
AND '13 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Apr 2023','Sick','13 Apr 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8861'
AND '11 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'11 Apr 2023','Sick','12 Apr 2023', 1,0,1,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8861'
AND '03 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Apr 2023','Sick','04 Apr 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8863'
AND '06 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Feb 2023','Sick','20 Mar 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8863'
AND '26 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'26 Jan 2023','Sick','26 Jan 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8871'
AND '10 Jul 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'10 Jul 2023','Sick','14 Jul 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8872'
AND '02 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'02 Mar 2023','Sick','02 Mar 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8874'
AND '26 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'26 Jun 2023','Sick','26 Jun 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8875'
AND '15 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 May 2023','Sick','15 May 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8875'
AND '06 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Mar 2023','Sick','06 Mar 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8876'
AND '17 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'17 Apr 2023','Unpaid Leave','20 Apr 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8876'
AND '11 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'11 Apr 2023','Sick','11 Apr 2023', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8876'
AND '05 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'05 Apr 2023','Sick','06 Apr 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8876'
AND '03 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Apr 2023','Sick','03 Apr 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8876'
AND '10 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'10 Feb 2023','Unpaid Leave','10 Feb 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8876'
AND '08 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'08 Feb 2023','Sick','09 Feb 2023', 1,0,1,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8877'
AND '26 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'26 May 2023','Unpaid Leave','26 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8878'
AND '30 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'30 May 2023','Sick','21 Jul 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8878'
AND '15 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 May 2023','Sick','26 May 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8878'
AND '12 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'12 May 2023','Sick','12 May 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8878'
AND '11 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'11 May 2023','Unpaid Leave','11 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8878'
AND '24 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'24 Apr 2023','Sick','25 Apr 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8878'
AND '12 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'12 Apr 2023','Sick','12 Apr 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8878'
AND '20 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'20 Mar 2023','Sick','21 Mar 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8878'
AND '03 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Mar 2023','Sick','03 Mar 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8878'
AND '22 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'22 Feb 2023','Sick','22 Feb 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8880'
AND '27 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'27 Jun 2023','Sick','27 Jun 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8881'
AND '22 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'22 May 2023','Sick','26 May 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8881'
AND '28 Feb 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'28 Feb 2023','Sick','28 Feb 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8882'
AND '07 Jul 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'07 Jul 2023','Sick','07 Jul 2023', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8882'
AND '09 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'09 Jun 2023','Unpaid Leave','09 Jun 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8882'
AND '09 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'09 Mar 2023','Unpaid Leave','09 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8886'
AND '06 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Mar 2023','Unpaid Leave','08 Mar 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8889'
AND '06 Jul 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Jul 2023','Sick','07 Jul 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8889'
AND '31 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'31 May 2023','Unpaid Leave','31 May 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8889'
AND '20 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'20 Apr 2023','Sick','20 Apr 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8889'
AND '24 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'24 Mar 2023','Sick','24 Mar 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8894'
AND '08 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'08 Mar 2023','Sick','09 Mar 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8896'
AND '25 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'25 May 2023','Sick','25 May 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8898'
AND '06 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'06 Jun 2023','Sick','07 Jun 2023', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8898'
AND '03 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 May 2023','Sick','03 May 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8899'
AND '19 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'19 Jun 2023','Sick','19 Jun 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8899'
AND '11 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'11 May 2023','Sick','12 May 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8899'
AND '04 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'04 May 2023','Sick','05 May 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8899'
AND '30 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'30 Mar 2023','Sick','30 Mar 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8900'
AND '19 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'19 Apr 2023','Sick','19 Apr 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8901'
AND '25 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'25 Apr 2023','Sick','28 Apr 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8902'
AND '13 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Jun 2023','Unpaid Leave','19 Jun 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8902'
AND '13 Mar 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Mar 2023','Sick','13 Mar 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8903'
AND '14 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Jun 2023','Sick','15 Jun 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8904'
AND '12 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'12 May 2023','Unpaid Leave','12 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8907'
AND '15 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 Jun 2023','Sick','16 Jun 2023', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8907'
AND '15 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 May 2023','Sick','16 May 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8907'
AND '04 Apr 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'04 Apr 2023','Sick','05 Apr 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8908'
AND '13 Jul 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'13 Jul 2023','Sick','14 Jul 2023', 1,0,1,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8916'
AND '05 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'05 Jun 2023','Sick','06 Jun 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8916'
AND '10 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'10 May 2023','Sick','12 May 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8918'
AND '15 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'15 Jun 2023','Sick','16 Jun 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8918'
AND '09 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'09 Jun 2023','Sick','09 Jun 2023', 1,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8918'
AND '25 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'25 May 2023','Sick','26 May 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8919'
AND '09 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'09 May 2023','Sick','09 May 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8920'
AND '27 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'27 Jun 2023','Sick','07 Jul 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B8928'
AND '30 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'30 May 2023','Sick','30 May 2023', 1,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B116686'
AND '05 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'05 Oct 2022','Sick','05 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B116686'
AND '03 Oct 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Oct 2022','Sick','03 Oct 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B119588'
AND '19 Jun 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'19 Jun 2023','Sick','19 Jun 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B119588'
AND '23 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'23 May 2023','Sick','25 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B119588'
AND '17 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'17 May 2023','Sick','17 May 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B180729'
AND '10 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'10 May 2023','Unpaid Leave','10 May 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B180729'
AND '30 Jan 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'30 Jan 2023','Sick','03 Feb 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B604058'
AND '03 Jul 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'03 Jul 2023','Sick','04 Jul 2023', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B604058'
AND '04 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'04 Nov 2022','Sick','04 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B616522'
AND '12 May 2023' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'12 May 2023','Sick','12 May 2023', 0,1,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B620042'
AND '05 Dec 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'05 Dec 2022','Sick','05 Dec 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B620042'
AND '14 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'14 Nov 2022','Sick','17 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B620042'
AND '09 Nov 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'09 Nov 2022','Sick','10 Nov 2022', 0,0,0,1)
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id],[Start_Date],[Reason],[End_Date],[Unpaid],[Half_Day_Start],[Half_Day_End],[Completed_Absence])
VALUES((SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT INNER JOIN DT_EMPLOYEE
ON Left_Join = Entity_Id AND CAST(EmployeeID as varchar(20)) = 'B620042'
AND '18 Jul 2022' BETWEEN Start_Date AND ISNULL(End_Date, '31 dec 2499')),'18 Jul 2022','Sick','19 Jul 2022', 0,0,0,1)
