Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to get the no. of records of a child table ?
Message
 
 
To
12/05/2009 23:38:35
Yim Ming Sun Derek
Spacious Design Consultant
Hong Kong, Hong Kong
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01399535
Message ID:
01399584
Views:
48
>Hi,
>I have a form which is to maintain the Invoice records in one to many relation, invoice header table and the invoice detail.
>When I browse the Invoice header table, I want to know how many child records refer one invoice no.
>Is there any system variable or function to get the no. of child records ?
>
>Please advise.
>
>Derek Yim

It depends on what exactly you're using. If you're using tables directly than perhaps you can do
lnInvoiceID = Invoice.InvoiceID
select InvoiceDetails
count to lnInvDetails for InvoiceID = m.lnInvoiceID
Alternatively you can use select-SQL statement if you didn't make any changes to the tables yet.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform