I want to Insert into table based on a condition.
There are 3 tables
Create Table ContLeave (Startdate smalldatetime , Enddate smalldatetime)
Insert Into ContLeave
Select '2016-01-03' , '2016-01-03'
Select '2016-01-10' , '2016-01-10'
Select '2016-01-15' , '2016-01-17'
Select '2016-01-24' , '2016-01-24'
Select '2016-01-26' , '2016-01-26'
(Result received from stephen hendricks)
This table contains the leave days for given month
Create Table Absentdata (Ecode varchar(12),Absentdate smalldatetime,LOP float)
Insert Into Absentdata
This table contains the absentees data employeewise datewise
Table in which data to be inserted
If the employee absents himself before and after a leave day, then all holidays has to inserted in C15LL
Input data sample
Thanks in advance