Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Averaging values...
Message
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00275334
Message ID:
00275355
Views:
17
VFP won't disallow blanks because to VFP a blank numeric is zero. VFP will ignore NULL values though. If you set teh default value property for the fields to NULL then you will get what you want.

Another way to get what you want is to create two report variables (on the Report menu). One named lnSum adn the other lnCount. Set the initial value of both of these to 0 and the value to store would be;

lnSum = lnSum + IIF(Field<>0,Field,0)

lnCount lnCount + IIF(Field<>0,1,0)

Then for your average you put this expression in the report field;

IIF(lnCount=0,0,lnSum/lnCount)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform