Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Counting Child Records
Message
From
07/05/2002 22:34:23
Cindy Winegarden
Duke University Medical Center
Durham, North Carolina, United States
 
 
To
07/05/2002 20:22:56
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00653805
Message ID:
00653824
Views:
18
>I have two tables related together and want to be able to count the number of associated child records whenever I move the pointer in the parent table.
>
>How do I do this?

Bruce, depending on how you're moving your pointer you could use the following. I'm guessing that you're moving the pointer in a grid and have the count showing in a text box or label.
SELECT Count(*) FROM Child ;
    WHERE Child.ForeignKey = Parent.PrimaryKey ;
    INTO ARRAY laCount
You can use the laCount[1] like a variable by just using laCount.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform