I have the following query in MS Access 2013 than does not return a Median value.
The field IU is always NULL (blank) or 1. Column GM is a number formatted 0.0000 betwe
Ask your DMedian
expression to ignore any Nulls in the GM field.
SELECT IU, DMedian("GM","tblFirst250","IU=1 AND GM Is Not Null") AS MedianByIU
FROM tblFirst250
WHERE IU = 1
GROUP BY IU;
Basically what happened is DMedian
opened a recordset sorted by GM and then moved (roughly) half way through the recordset to get the median value. But if the value in that row happened to be Null ...
GM
--
Null
Null <- median
2
... DMedian
told you the median is Null. So instructing DMedian
to load only rows where GM Is Not Null
gave you the median of the non-Null values.