Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to find out the last Child of a Hierarchy Chain

Status
Not open for further replies.

PD81

IS-IT--Management
May 14, 2010
12
GB
Hi,
I am working on a report which deals with Hierarchy parent-child relationship. The database is MS Access and using Crystal report
2008.
Requirement:-
I need to show 3 fields of top most table (supress rest) and have to show all fields of the last-most table in the chain.
Relationship
I have created multiple Alias of 'RQ' table to create hierarchy Links are 1 )RQ1.id left outer join RQ2(Alias).parent 2)RQ2.id left outer join RQ3(Alias) and so on......
I can determine the topmost table here by finding where Parent is blank but how do I find out the lowest level (Last most) table?

Please suggest
Many thanks



-cheers
Puneet
 
You have defined the lowest level table as RQ3, so it is unclear what the question is.

-LB
 
HierarchyLevel is available as a function, so you could conditionally suppress sections based on that function.

The final member of a group could be saved in a variable and used in a section after the group. if you want to use it before then, you might need a subreport in the report header and process the hierarchy in that to see what your final group is.

I will be publishing some hints about hierarchical groups in my blog over the next few weeks. I'll see if I can find another way to solve your problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top