yippie_ky_yay
Registered User.
- Local time
- Today, 16:54
- Joined
- Jul 30, 2002
- Messages
- 338
Hello everyone,
I'm a little stumped on something. I would like to know how many levels down something is in a hierachy.
Table_Hierarchy
ParentID
ChildID
Here are some typical entries (1 for President, 2 for Manager, 3 for Secretary)
1 2
2 3
If you follow this, 3 is a child to 2 which in turn is a child to 1. I would like to be able to know that there are two levels above 3 (my current hierarchy varies from 1 to about 8 levels!) Could someone help with this please? My brain just won't process this one!
Thanks in advance,
-Sean
I'm a little stumped on something. I would like to know how many levels down something is in a hierachy.
Table_Hierarchy
ParentID
ChildID
Here are some typical entries (1 for President, 2 for Manager, 3 for Secretary)
1 2
2 3
If you follow this, 3 is a child to 2 which in turn is a child to 1. I would like to be able to know that there are two levels above 3 (my current hierarchy varies from 1 to about 8 levels!) Could someone help with this please? My brain just won't process this one!
Thanks in advance,
-Sean