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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I detect the number of child records in a relationship 2

Status
Not open for further replies.

GuitarSlayer

Programmer
Dec 16, 2004
29
0
0
GB
I have two tables which have a relationship set. When the record pointer is moved in the Parent I need to know how many records there are in the Child. Any Ideas on how I can achieve this?
 
The way I do it, is to SEEK on the parent key value and then do a COUNT REST WHILE parentkeyvalue = childkey.

Rick
 
(Assume the relation expr. is Code)
In the Parent alias:
SET SKIP TO (chindren alias)
GO RECN()
m.Code= Code
COUNT TO NumberOfRec WHILE chindren.Code = m.Code
(that ~ move to next record in Parent alias)


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top