IIF statement run amuck

  • Thread starter RedHeadedMonster via AccessMonster.com
  • Start date
R

RedHeadedMonster via AccessMonster.com

I'm running a query that shows sums of several fields. For one field I want
to replace a null with 14. Im using the follwoing conditional statement in
the criteria for field ARO:

=IIf(IsNull([ARO]),"14",[ARO])

The query runs fine. Problem is it removes any row where this field is null.
I've tried everything I can think of to get the query to run the way i need
it to.

Any ideas as to what I've done wrong?

RHM
 
A

Allen Browne

Where in the query did you put this?

I think you want it in the Field row, so you see the 14 wherever the ARO
field is null, not in the Criteria row where it will limit the results.

BTW, if ARO is a Number field (not a Text field), drop the quotes around the
14. Try:
=IIf([ARO] Is Null, 14, [ARO])
 
R

RedHeadedMonster via AccessMonster.com

Thanx, Worked like a charm.
RHM

Allen said:
Where in the query did you put this?

I think you want it in the Field row, so you see the 14 wherever the ARO
field is null, not in the Criteria row where it will limit the results.

BTW, if ARO is a Number field (not a Text field), drop the quotes around the
14. Try:
=IIf([ARO] Is Null, 14, [ARO])
I'm running a query that shows sums of several fields. For one field I
want
[quoted text clipped - 9 lines]
need
it to.
 

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

Top