J
John S. Ford, MD
I created a field within a query with the following (in the query design
grid):
BPControl1: IIf(Count([BPControl])=0, "N/A",
Format(100*Abs(Sum([BPControl]=1))/(Count([BPControl])),"0.0") & "%")
BPControl is a field in this query's datasource (also a query) that is an
integer (1, 2 or 3) representing the degree to which a patient's blood
pressure is under control. What I'm trying to do is calculate the
percentage of patients with a BPControl value of 1. (I will also have a
BPControl2 and BPControl3 field.)
The problem is when I run this query, I get the following error message:
"Datatype mismatch in criteria expression."
I assumed that this message arises from the Count([BPControl])=0 clause but
it persists even if I replace it with "True". If I remove this field
completely from the query, the rest of the query works fine with no errors.
Any ideas as to why this is happening? I don't even know where to start in
troubleshooting this. I've not had too many problems with IIf() statements
before (even within the same query).
John
grid):
BPControl1: IIf(Count([BPControl])=0, "N/A",
Format(100*Abs(Sum([BPControl]=1))/(Count([BPControl])),"0.0") & "%")
BPControl is a field in this query's datasource (also a query) that is an
integer (1, 2 or 3) representing the degree to which a patient's blood
pressure is under control. What I'm trying to do is calculate the
percentage of patients with a BPControl value of 1. (I will also have a
BPControl2 and BPControl3 field.)
The problem is when I run this query, I get the following error message:
"Datatype mismatch in criteria expression."
I assumed that this message arises from the Count([BPControl])=0 clause but
it persists even if I replace it with "True". If I remove this field
completely from the query, the rest of the query works fine with no errors.
Any ideas as to why this is happening? I don't even know where to start in
troubleshooting this. I've not had too many problems with IIf() statements
before (even within the same query).
John