I have 10 employee details in one table with employeeid
Every day i have to allocate some work to those 10 employee.
If i forgot to allocate work for 2 employee out of 10.
How i find allocated employee and unallocated employee....
I need the query....
Loading
Kunal VaishyaPosted Jun 19, 2012, 4:19 AM
Select EmpId , EmpName From EmployeeMaster Where EmpId Not In (SELECT EmpId From AllocationTable Where DateTime ='GetDate' )
You can get UnAllocatted Employee Using This Query For PArtucaular Day You can also pass data instead of "Getdate"
Jignesh TrivediPosted Jun 19, 2012, 3:58 AM
First we required table structure which is used by you.
after that we able to write query for you.
Or You required any input for design table?
thx.
Santhosh Kumar JayaramanPosted Jun 19, 2012, 3:35 AM
Table -Employee
ID, -EMployee Id
Name-Employee names
Table- Allocation
ID -Foreign key ref
Date- For each date
Status- Allocated(Y) or Not(N).
to find empl allocated:
Select * from Employee where id in (select id from Allocation where date ='' and status='Y'))
to find those who are not allocated
Select * from Employee where id in (select id from Allocation where date ='' and status='N'))
sr harPosted Jun 19, 2012, 3:22 AM
sr harPosted Jun 19, 2012, 3:21 AM