Computing Median

M

mcl

I need to compute the median not an average.
Using help in Access 2000 it says there is a worksheet function "median".
No there is not. It says undefined function when I try to use it.
I have found the help in access 2000 to be totally worthless. It gives me
answers that are out and out wrong.
 
M

mcl

I did a search for median in access2000 help and that's all I got. A
worksheet function that doesn't really exist.
 
M

MGFoster

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The VBA help also includes the Excel VBA help, that's where the Median()
function description is coming from.

Here is a query I found on an SQL Server newsgroup that supposedly finds
the median (I've changed it's syntax so it can be used in Access -
substitute your column names and table names) [this query is untested in
access]:

SELECT AVG(splunge1) As Median
FROM
(
SELECT splunge1 FROM (
SELECT TOP 1 splunge2 * 1.0 As splunge1 FROM
(
SELECT TOP 50 PERCENT splunge2
FROM blat ORDER BY splunge2
) As sub_a
ORDER BY 1 DESC
) As sub_1
UNION ALL
SELECT splunge1 FROM (
SELECT TOP 1 splunge * 1.0 As splunge1 FROM
(
SELECT TOP 50 PERCENT splunge2
FROM blat ORDER BY splunge2 DESC
) As sub_b
ORDER BY 1
) As sub_2
) As median
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQycVvYechKqOuFEgEQIfmQCgjD/E/IqAwX+6yfS2rcsuPf77uMwAoPfx
kkIpTi9HrhP8r8chWHLDoWD8
=ssYD
-----END PGP SIGNATURE-----
 
Top