This is the expression I am using now thanks to your help:
At Risk?: IIf([Result]>=[75th],"Yes",IIf([75th] Is Null,"Age Out Of
Parameters","No"))
Because the field [At Risk?] was no longer a Yes/No format in the query I
changed it to text requiring the " " before and after the text answers I
wanted to use.
This is in a query with a one sided join between two tables. One table is
a
set of constant ratios, lab values to age in hours. The other table has
all
gathered lab values in the hospital.
If the lab value at a given age in hours in table 1 is > or = the constant
value in table 2 the test value is flagged with a yes. My report is
conditionally formatted to return in red any yes values. Lab values
drawn
at the age of <12 hours or >124 hours are not plotted and return a null
value.
The concept of IS NULL rather than =Null didn't occur to me but you guys
helped me with that.
Thanks again.
BruceM said:
There is much I have yet to understand. This one has me baffled,
particularly that a Yes/No field could be > or < another field. Still,
thanks for the response.
Jeff C said:
Thank you guys for the solution, I haven't worked with null values much
before. The Yes/No works in my query without quotes because the filed
properties are formated as a Yes/No.
:
In both your reply and Roger's reply there are no quote marks around
the
Yes
and No. If they aren't necessary, could you explain why? I had
thought
that to see the word Yes or No in the field they would need to have
quote
marks around them, same as for "Age Out Of Parameters".
message
Null isn't a value, it is the absence of a value, so you can't test
to
see
if you're equal to it.
At Risk?: IIf([Result]>=[75th],Yes,IIf([75th] Is Null, "Age Out Of
Parameters",No))
or
At Risk?: IIf([Result]>=[75th],Yes,IIf(IsNull([75th]), "Age Out Of
Parameters",No))
Also, I don't recommend the question mark in the field name.
--
Wayne Morgan
MS Access MVP
At Risk?: IIf([Result]>=[75th],Yes,No) - This works fine in my
query
I discovered though that I am getting null values in [75th] which
returned
"No" in [At Risk?] so I changed expression:
At Risk?: IIf([Result]>=[75th],Yes,iif([75th]=Null, "Age Out Of
Parameters",No)) - Which does not work
At Risk should = "Yes" OR "No" OR "Age Out Of Parameters"
Can anyone offer a solution? Thank you.