I am stumped by this stupid code.
We have several fieldnames but two significant ones are ManagerID and SupervisorID
Supervisor is over Managers and Managers are over employees.
Manager managers one group and Supervisor manages all the groups called dept.
We would like display records belonging to a supervisor or his/her department.
The following code keeps displaying all employees under a manager.
Not sure why.
select distinct d.SupervisorName,a.filenameName,a.filePath, e.empID,e.employeeName,e.department,e.unitName from Angulers as a inner join Employee as e on e.empnum= a.empnum left join departmentheads d on e.deptnum =d.deptnum where d.supervisorID = @supervisor