Can I assume that you got an error with the recommended expression I
provided? If so, what was the error? Reviewing what I posted, I find
that I missed some parentheses. Here is the expression rewritten. It
seems to have the same number of left and right parentheses and they
seem to be in the correct places.
IIF(DCount("*","UM","[13] IN ('Y','N')") = 0, "N/A" ,
DCount("*","UM","[13] ='Y'") / DCount("*","UM","[13] IN ('Y','N')"))
'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================
Let me explain the problem clearer. I have a table with fields headings in
numbers. The data in the fields is Y, N, or N/A. I want to calculate the
percentage of the count of Y over the count of Y and N, exclude N/A in the
denominator. But first I needed to filter out a certain selection in the
table only. That is why I made a query called "UM"( to filter out records
entered on certain date only). Now I want to calculate the number of Y/(N+Y)
based on data filtered by the query. I learned that you can't calculate if
the query has a parameter, or could you? The formula I use to calulate the Y
and N of field 13 in the query UM is
=DCount("[UM]![13]","UM","[UM]![13]='Y'")/(DCount("
[UM]![13]","UM","[UM]![13]='Y'")+DCount(" [UM]![13]","UM","[UM]![13]='N'"))
which works fine until all the data is if that field is "N/A", neither "Y'
or "N". Now I need a fomula that returns "N/A" if this is the case instead of
returning an error message. Please please help......