Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Difference between tables and cursors?
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00107285
Message ID:
00107788
Views:
19
Marius,

When using Sum(), SELECT the table you are using, instead of referring to it with Table.Field.

SELE MyCursor
? sum(MyField)

instead of
? sum(mycursor.myfield)

HTH
Barbara

>Why is it when I try to SUM() on a cursor, I get a result of the first record's data multiplied by reccount(). If I attempt the same thing on a table, the result is correct?
>
>SUM(user.amount) TO xx
>
>If I use a table with 2 records, the first amount = 2 second amount = 3, the answer is 5. If I do the same command on a cursor, the answer is 4. It seems to take the first value it sees as all values.
>
>Any suggestions?
>
>M. Carpio
>MIS - Pep Boys
Barbara Paltiel, Paltiel Inc.
Previous
Reply
Map
View

Click here to load this message in the networking platform