IIF statement to compare two fields.

  • Thread starter E-mail report using Lotus Notes rather t
  • Start date
E

E-mail report using Lotus Notes rather t

Hi,

I would like to use the IIF statement to compare two fields in Access query
design view. I would like to compare two fields in a query. I know how to
do it in Access using IF statement (i.e. IF(A1=A2, "Yes","No"). Please tell
me how to write an IIF statement in Access to compare two fields. Thank you.

Regards.
 
K

KARL DEWEY

In design view in Field row blank use this with your actual field names --
My_IIF_Results: IIF([Field1] = [Field2], "Yes", "No")
 
J

Jerry Whittle

CompareFields: IIf([Field1]=[Field2],"Yes","No")

However you have to watch out for nulls.

Debug.Print IIf(Null = Null,"Yes","No") will return No even though they are
both nulls.
 
Joined
Dec 3, 2009
Messages
2
Reaction score
0
Hi, I have a question in regards to IIF statement,
I want to serach within the same colmun for records that starts with "SHS" or "SCS" when found, then divide the balance field by 200
Then search for records that starts by "s260" or "SSPC" and divide the balance field by 170.
Could anyone help me?
Thanks
 

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