Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sum stmt causing another table to go eof
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00442341
Message ID:
00442367
Vues:
8
>I have a simple sum statement on table a. This sum statement is within a scan/endscan of table b.
>
>When I run the sum statement on table a it sends table b immediately to eof().
>
>It seems to be acting as if I have a relation set from table a to table b, but I don't.
>
>Any ideas?
>
>Thanks,
>Paul

SUM works on the currently selected table. So if you've got your SUM command inside a SCAN, you'll actually be moving the SCAN's file pointer to the end.

SELECT b
SCAN
SUM a.test TO SumValue
ENDSCAN

You'll actually only move the pointer for b to the end after the first record.

SELECT b
SCAN
SELECT a
SUM a.test TO SumValue
ENDSCAN

If you add the SELECT a before you do the SUM, the SUM will not move b's pointer. The ENDSCAN will automatically reselect b to continue the SCAN.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform