Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Replacing data in parent with the sum values of the chil
Message
 
 
À
12/03/2001 14:12:22
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00484178
Message ID:
00484183
Vues:
14
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform