Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Replacing data in parent with the sum values of the chil
Message
 
 
To
12/03/2001 14:12:22
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00484178
Message ID:
00484183
Views:
13
>i have two tables
>Table1 is having partno as a primary index Parent
>Table2 is having partno as a regular index Child
>
>how can i take the qty's of the partno in the child and Sum it to
>the parent,
>
>i have more than 15,000 record in the child table and around 2,000
>records in the parent.
>thanks for the Help
select partno, sum(qty) as sum_qty from child group by partno into cursor curSum
index on partno tag partno && First time it's allowed
select Parent
set relation to partno into curSum
replace Parent.Qty with curSum.Sum_Qty for found('curSum')
Unfortunately, it could not be done through update command, because VFP doesn't support this type of Update.

HTH
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform