Query Problem

crhodus

Registered User.
Local time
Today, 06:19
Joined
Mar 16, 2001
Messages
257
Hi everyone,

I'm having problems trying to figure out how to write a query.

I have a table that contains employee information. Each employee is assigned a unique employee id. Each employee is also assigned a supervisor. The supervisor field contains an employee id.

I need to write a query so that a supervisor can pull up all their employees. If one of the supervisor's employees is also an employee, I need the query to also pull up those employes as well. Hope I'm making my self clear.

Employee Table
ID Name Sup_ID
01 JohnA 02
02 JaneD 03
03 LukeT 05

JohnA runs the query and has no results returned to him.
JaneD runs the query and has 1 results returned to her (01, JohnA).
LukeT runs the query and has 2 results returned to him (01, JohnA; 02 JaneD).

Thanks,
CR Junk
 
best way to handle is to use a recursive VBA routine. Search for recursive here, you will find examples.
 
Thanks for the info!
Crhodus
 

Users who are viewing this thread

Back
Top Bottom