Please help !!
We are currently developing a company database on Access 2000 ... in our "employee" table we have a recursive relationship between supervisors and employees (I guess a 1 to many relationship) ...
The db Table "employee" can be summarised as follows:
empNo
empName
position
dept
supervisorNo
(for simplicity position enumerates to "Associate" or "Manager" ... in reality the hierarchy is much more complicated than this however anything above two positions is way too difficult for us to contemplate at the moment!!)
Background:
We have not yet developed the form interface and are working with tables only ... we have set up all managers and departments (with supervisorNo set to Null) ... and are at the stage of entering the employees.
Problem:
When entering the Associate employees we want the supervisor selection to auto-fill or restrict the supervisor list depending on department selected. Unfortunately all managers are displayed which could lead to an associate being managed by someone in another department (if data entered incorrectly)!!
This is where we've got with our SQL ...
SELECT E1.empNo
FROM employee AS E1, employee AS E2
WHERE ((E1.[dept] = E2.dept) AND (E2.position='Manager'));
Are we on the right tracks?? Any help or guidance would be really appreciated...
SP
We are currently developing a company database on Access 2000 ... in our "employee" table we have a recursive relationship between supervisors and employees (I guess a 1 to many relationship) ...
The db Table "employee" can be summarised as follows:
empNo
empName
position
dept
supervisorNo
(for simplicity position enumerates to "Associate" or "Manager" ... in reality the hierarchy is much more complicated than this however anything above two positions is way too difficult for us to contemplate at the moment!!)
Background:
We have not yet developed the form interface and are working with tables only ... we have set up all managers and departments (with supervisorNo set to Null) ... and are at the stage of entering the employees.
Problem:
When entering the Associate employees we want the supervisor selection to auto-fill or restrict the supervisor list depending on department selected. Unfortunately all managers are displayed which could lead to an associate being managed by someone in another department (if data entered incorrectly)!!
This is where we've got with our SQL ...
SELECT E1.empNo
FROM employee AS E1, employee AS E2
WHERE ((E1.[dept] = E2.dept) AND (E2.position='Manager'));
Are we on the right tracks?? Any help or guidance would be really appreciated...
SP