Hi
thanks for reading
I have 2 tables. The first has employee information and
the second has
payroll information. I need to find out people who are not
in the
payroll but in the employee table.
Since the payroll has multiple instances i have to filter
it and find
out for each payroll.
I don't think i have explained it very well so here is the
data set.
hope someone can help me with this.
Thanks in advance
prit
Tbl Employee
PlanIDSSN
1001111111111
1001222222222
1001333333333
TblPayrolldetail
IDNumPlanID SSN
11001111111111
11001222222222
21001222222222
21001333333333
Required RESULT required(Missing employees for each pay
period)
IDNumSSN
1333333333
2111111111
If you have a table with all the IDNum values (IDNum represents a pay
period?), use it, or if not,
(select Distinct IDNum from TblPayrolldetail) IDs
where I have
IDs
select IDs.IDNum, [Tbl Employee] SSN
from IDs, [Tbl Employee]
where not exists (
select * from TblPayrolldetail D
where D.IDNum = IDs.IDNum
and D.SSN = [TblEmployee].SSN
)
Steve Kass
Drew University
PM wrote:
>Hi
>thanks for reading
>I have 2 tables. The first has employee information and
>the second has
>payroll information. I need to find out people who are not
>in the
>payroll but in the employee table.
>Since the payroll has multiple instances i have to filter
>it and find
>out for each payroll.
>I don't think i have explained it very well so here is the
>data set.
>hope someone can help me with this.
>Thanks in advance
>prit
>
>Tbl Employee
>PlanIDSSN
>1001111111111
>1001222222222
>1001333333333
>TblPayrolldetail
>IDNumPlanID SSN
>11001111111111
>11001222222222
>21001222222222
>21001333333333
>Required RESULT required(Missing employees for each pay
>period)
>IDNumSSN
>1333333333
>2111111111
>
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment