Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
TOTALing a child table
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
TOTALing a child table
Divers
Thread ID:
00606502
Message ID:
00606502
Vues:
42
I have a table, LineItems, which is related into Details:
I scan through LineItems, and for each related child record, I
total up a field called CallAct:


SELECT LineItems
SCAN

  nTotal = 0

  SELECT Details
  IF NOT EOF()
    DO WHILE NOT EOF()
      nTotal = nTotal + Details.CallAct
    ENDDO
  ENDIF

  REPLACE IN LineItems CallTot WITH nTotal NEXT 1

ENDSCAN


Anyone know how I can do this using SQL?

Many thanks
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform