Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Generating Statistics Info
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00223474
Message ID:
00223571
Vues:
17
>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform