Hi,
With
PolesAges
Pole Age
AM 2
AM 3
AS 5
AS 7
EU 9
EU 3
EU 2
the query
SELECT c.Pole, Min(c.age) AS MinOfage
FROM (SELECT a.Pole, a.age
FROM PolesAges AS a INNER JOIN PolesAges AS b ON a.Pole=b.Pole AND
a.Age>=b.Age
GROUP BY a.Pole, a.Age
HAVING Count(*) / (SELECT COUNT(*) FROM PolesAges As d WHERE
d.Pole=a.Pole) >=0.5) AS c
GROUP BY c.Pole;
returns
MediansByGroup
Pole MinOfage
AM 2
AS 5
EU 3
which, as you see, previlegiate the lowers values, or, technically, return
the lowest "age" for which at least 50% or more of the record supply a lower
age, given the Pole (GROUP)... and that, including the returned record.
Hoping it may help,
Vanderghast, Access MVP