robmkimmons
Technical User
I have an employee table tbl_Master that has a list of employees including their position number [PosNum]. Another field in the table identifies who they report to [RptToPosNum]. I am trying to query the "front-line" leaders aka: Employees who's direct reports do not have direct reports of their own. Below is the simplified version of the table--
tbl_Master:
[EmpName]
[PosNum]
[RptToPosNum]
Here is the SQL:
SELECT tbl_Master_1.Name AS SupvName, tbl_Master_1.PosNum
FROM tbl_Master INNER JOIN tbl_Master AS tbl_Master_1 ON tbl_Master.RptToPosNum = tbl_Master_1.PosNum;
The PROBLEM is this brings up any leader who has a direct report (meaning it could be a leader of a leader). I want to pull out only those leaders who's direct reports have no direct reports. I have been racking my brain on this and i'm sure there is a simple solution.
Thanks!
~Rob
If we expect the unexpected, does that make the unexpected... well, expected?
tbl_Master:
[EmpName]
[PosNum]
[RptToPosNum]
Here is the SQL:
SELECT tbl_Master_1.Name AS SupvName, tbl_Master_1.PosNum
FROM tbl_Master INNER JOIN tbl_Master AS tbl_Master_1 ON tbl_Master.RptToPosNum = tbl_Master_1.PosNum;
The PROBLEM is this brings up any leader who has a direct report (meaning it could be a leader of a leader). I want to pull out only those leaders who's direct reports have no direct reports. I have been racking my brain on this and i'm sure there is a simple solution.
Thanks!
~Rob
If we expect the unexpected, does that make the unexpected... well, expected?