1. How do you mean it fails to work? Do you get an error?
2. You need to supply the category as in the query examples:
=DMedian97("qryLeadtime","Leadtime","[Category] = '" & [Category] & "'")
This MAY solve both of your problems, depending on what the problem with the
Null is:
=DMedian97("qryLeadtime","Leadtime","[Category] = '" & [Category] & "' and
[Leadtime] Is Not Null")

Signature
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
> Roger,
>
[quoted text clipped - 73 lines]
> >> >>
> >> >> Scott
Scott - 29 Nov 2006 15:20 GMT
Roger,
Many thanks for your further advice.
Access did not accept your suggestion statements and returned an error
message saying "The expression you entered contains invalid syntax. You may
have entered an operand without an operator.".
I looked at your 2k Median example database again. There are two modules:
one is ADO and function name = DMedian(FieldName,TableName,Criteria) and
another one is DAO and function name
=DMedian97(TableName,FieldName,Criteria). I imported both into my Access
2003 application. Is there any error I have made? Which function should I
use?
My report is based on a query that linked with a table. The report is
grouped by category and the Median function is applied to the footer of
category group. You further advice is highly appreciated.
Thanks,
Scott
> 1. How do you mean it fails to work? Do you get an error?
>
[quoted text clipped - 95 lines]
>> >> >>
>> >> >> Scott
Roger Carlson - 29 Nov 2006 19:38 GMT
OK, I wasn't reading your post closely enough. You have the order of
arguments wrong. It should be:
=DMedian("Leadtime","qryLeadtime","[Category] = '" & Category & "'")
This assumes that 1) qryLeadtime is the query being used as the Record
Source for the Report. 2) Leadtime is the field that you want to find the
median for, and 3) Category is the field you are grouping on and it is a
text field. If Category is a numeric field, it would be this:
=DMedian("Leadtime","qryLeadtime","[Category] = " & Category )
The only difference between DMedian and DMedian97 is that DMedian97 used
DAO. DMedian uses ADO. There is no need to import both of them.
If this doesn't help, I'm stuck too.

Signature
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
> Roger,
>
[quoted text clipped - 118 lines]
> >> >> >>
> >> >> >> Scott