Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL & Report average
Message
From
03/09/1999 07:29:15
Cindy Winegarden
Duke University Medical Center
Durham, North Carolina, United States
 
 
To
03/09/1999 06:19:00
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00261040
Message ID:
00261052
Views:
34
E C,

You have to be careful with averages done within reports. As Neil pointed out, if the staff member has 2 telephone records, his salary will be counted twice and the average will not be correct.

You may need to do the average calculation outside the report and assign it to a memory variable or property of your calling form.

The problem I had with averages was with averaging over records that had value > 0 rather than over all records. I had to get the numerator and denominator with report variables.


>I using SQL to select the records I wanted as follow :
>
> SELE pay.staff,pay.salary,staff.tel ;
> FROM pay,staff ;
> WHERE pay.staff = staff.staff ;
> INTO CURSOR temp
>
>The problem is if staff have 2 tel, when I run the report the average salary will be incorrect.
>
>Can anyone help me to find out the solution
>
>
>
>
>Thank u.
Previous
Reply
Map
View

Click here to load this message in the networking platform