A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

how do I create supervisor hierarchy with the access table



 
 
Thread Tools Display Modes
  #1  
Old December 17th, 2009, 09:58 PM posted to microsoft.public.access.queries
Helen Shah
external usenet poster
 
Posts: 3
Default how do I create supervisor hierarchy with the access table

I am trying to create a supervisor roll up table with the employee data
information. My table currently has employee id, employee name, supervisor id
and supervisor name. I am trying to create an organizational roll up up to 4
levels. E.g. Employee John Doe is reporting to Jim Smith who reports to Steve
Williams who reports to Jack Martin. I am trying to create a table such as
below through a query and not having much success. Any help will be much
appreciated.

Employee Name Supervior 1 Supervisor 2 Supervisor 3

John Doe Jim Smith Steve Williams Jack Martin
  #2  
Old December 17th, 2009, 10:26 PM posted to microsoft.public.access.queries
Dorian
external usenet poster
 
Posts: 542
Default how do I create supervisor hierarchy with the access table

Your design is not normalized and will give lots of problems when you try to
use it. You need something like:
EmployeeId
ReportsToId
where ReportsToId refers to another EmployeeId
the top guy has ReportsToId set to null (the buck stops here)
This arrangement allows unlimited levels.
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".


"Helen Shah" wrote:

I am trying to create a supervisor roll up table with the employee data
information. My table currently has employee id, employee name, supervisor id
and supervisor name. I am trying to create an organizational roll up up to 4
levels. E.g. Employee John Doe is reporting to Jim Smith who reports to Steve
Williams who reports to Jack Martin. I am trying to create a table such as
below through a query and not having much success. Any help will be much
appreciated.

Employee Name Supervior 1 Supervisor 2 Supervisor 3

John Doe Jim Smith Steve Williams Jack Martin

  #3  
Old December 17th, 2009, 11:33 PM posted to microsoft.public.access.queries
Gina Whipp
external usenet poster
 
Posts: 3,500
Default how do I create supervisor hierarchy with the access table

Helen,

Sounds like you are missing a *joiner* table...

tblEmployeeSupervisor
esEmployeeID (FK)
esSupervisorID (FK)

If in fact, you already have a table like the above then perhaps you need
this function...

http://allenbrowne.com/func-concat.html

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

"Helen Shah" wrote in message
...
I am trying to create a supervisor roll up table with the employee data
information. My table currently has employee id, employee name, supervisor
id
and supervisor name. I am trying to create an organizational roll up up to
4
levels. E.g. Employee John Doe is reporting to Jim Smith who reports to
Steve
Williams who reports to Jack Martin. I am trying to create a table such as
below through a query and not having much success. Any help will be much
appreciated.

Employee Name Supervior 1 Supervisor 2 Supervisor 3

John Doe Jim Smith Steve Williams Jack Martin



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:28 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.