Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Generating Statistics Info
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00223474
Message ID:
00223571
Views:
18
>Hi Bruce,
>
>As I said to Cetin, I'm no statistian, so I'll humbly bow out here (but not without taking one more shot< g >).
>LOCAL lnresult, lntotal, lnmin, lnmax
>lnresult = 0
>DIMENSION a_values[1]
>SELECT nField;
>  FROM MyTable;
>  ORDER BY nField;
>  INTO CURSOR MyValues
>lntotal = _TALLY
>IF lntotal > 0
>  IF (lntotal / 2) = INT(lntotal / 2)
>    * Even number of records
>    GOTO lntotal / 2
>    lnmin = MyValues.nField
>    SKIP
>    lnmax = MyValues.nField
>    lnresult = lnmin + ((lnmax - lnmin) / 2)
>  ELSE
>    * Odd number
>    GOTO CEILING(lntotal / 2)
>    lnresult = MyValues.nField
>  ENDIF
>ENDIF
>RETURN lnresult
>How's this?

Hey, I believe we're in business! Now we have several median experts :)
The Anonymous Bureaucrat,
and frankly, quite content not to be
a member of either major US political party.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform