expression with more than 1 criteria

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a field in my query where it looks at another field and if that field
is less than 450 it puts that amount in the field but if it is more than 450
it puts in 450. That part works fine, however when the field is blank or
empty I want this field to remain empty also. Here is the expression I have
so far:
IIf([MannedTime]<450,[MannedTime],450)
What do I need to do to have this field remain empty if the field
[MannedTime] is empty.
Thanks for your help
 
I have a field in my query where it looks at another field and if that field
is less than 450 it puts that amount in the field but if it is more than 450
it puts in 450. That part works fine, however when the field is blank or
empty I want this field to remain empty also. Here is the expression I have
so far:
IIf([MannedTime]<450,[MannedTime],450)
What do I need to do to have this field remain empty if the field
[MannedTime] is empty.
Thanks for your help

You can nest IIf statements.

=IIf(isNull(MannedTime]),"",IIf([MannedTime]<450,[MannedTime,450))
 
Thank you, it worked

fredg said:
I have a field in my query where it looks at another field and if that field
is less than 450 it puts that amount in the field but if it is more than 450
it puts in 450. That part works fine, however when the field is blank or
empty I want this field to remain empty also. Here is the expression I have
so far:
IIf([MannedTime]<450,[MannedTime],450)
What do I need to do to have this field remain empty if the field
[MannedTime] is empty.
Thanks for your help

You can nest IIf statements.

=IIf(isNull(MannedTime]),"",IIf([MannedTime]<450,[MannedTime,450))
 
Reverse the logic. Nulls (empty) will fail the test (first argument) and
therefore will return the second option (the third argument).

IIf([MannedTime]>=450,450,[MannedTime])
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top