Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Avg
Message
 
To
29/06/2004 08:04:54
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Re: Avg
Miscellaneous
Thread ID:
00918369
Message ID:
00918378
Views:
10
Chaim
The AVG function does not exist in the context that you are trying to use. You can use it if for instance you want the average off all the A column in you cursor, with either one of the following:
? calculate( avg( mycursor.a ) )
average mycursor.a to myAverage
In order to do what you want to achieve, you can manually calculate the average. Also, there is no need for a scan...endscan, use VFP scopes instead, as in
select MyCursor
replace all MyCursor.C with ( MyCursor.a + MyCursor.b ) / 2
HTH
Jaime

>I have a cursor with three columns.
>The third column (read only) is the avarage (a,b)
>the following command not working:
>
select mycursor
>scan
>replace mycursor.c with (avg(mycursor.a,mycursor.b)) in mycursor
>endscan
>What can I do?
Why do programs stop working correctly as soon as you leave the Fox?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform