I have been given a table with about 3,500 records with the following headers (simplified for the sake of this exercise):
staffID | name | reportsToID
I have to create a report that presents this data in a hierarchical form, something like this:
FD
FDSubordinate1
FDSubordinate2
CIO
CIOSubordinate1
CIOSubSubordinate1
CIOSubordinate2
Note that
- There are several top nodes (i.e. several people who do not have a boss)
- There is no limit to the number of sub-levels, but I doubt there are more than 9
- I wish to later perform some calculations with the numbers, so the output can't be in Visio etc.
What I'm looking for
The piece of VB (I assume) that along with a SQL query pulls out a workable output. What would be very useful would be sample db's if you've done similar things before.
I'm running Access 2003.
Start Free Trial