Equivalent of Excel AND() function?

A

Ann Scharpf

Is there an equivalent of Excel's AND() function in Access? I have looked
for threads related to "multiple conditions" but they all seem to be about
multiple conditions yielding the same result. I would like have my formula
yield a certain result only when two or more conditions are true. Right now
my formula is:

NewVendor:IIf([Category]="Leave","SL0001-1")

But I only want to assign the NewVendor SL0001-1 if the record also meets
the condition [AGoal]=True. Can I do this? I have looked in help and here
in the newsgroups and I'm not seeing it. Seems like if Excel can do it,
Access MUST be able to.

Thanks very much for your help.
 
D

Duane Hookom

When you use IIf(), you should provide 3 arguments like:

NewVendor:IIf([Category]="Leave" AND [AGoal]=True ,"SL0001-1", Null)
 
F

fredg

Is there an equivalent of Excel's AND() function in Access? I have looked
for threads related to "multiple conditions" but they all seem to be about
multiple conditions yielding the same result. I would like have my formula
yield a certain result only when two or more conditions are true. Right now
my formula is:

NewVendor:IIf([Category]="Leave","SL0001-1")

But I only want to assign the NewVendor SL0001-1 if the record also meets
the condition [AGoal]=True. Can I do this? I have looked in help and here
in the newsgroups and I'm not seeing it. Seems like if Excel can do it,
Access MUST be able to.

Thanks very much for your help.

NewVendor:IIf([Category]="Leave" AND [AGoal] = True,"SL0001-1","")
 
A

Ann Scharpf

Thank you Duane & fredg!

For future reference, is there a limit to the number of AND statements I can
embed within the IIf() statement?
--
Ann Scharpf


Duane Hookom said:
When you use IIf(), you should provide 3 arguments like:

NewVendor:IIf([Category]="Leave" AND [AGoal]=True ,"SL0001-1", Null)

--
Duane Hookom
Microsoft Access MVP


Ann Scharpf said:
Is there an equivalent of Excel's AND() function in Access? I have looked
for threads related to "multiple conditions" but they all seem to be about
multiple conditions yielding the same result. I would like have my formula
yield a certain result only when two or more conditions are true. Right now
my formula is:

NewVendor:IIf([Category]="Leave","SL0001-1")

But I only want to assign the NewVendor SL0001-1 if the record also meets
the condition [AGoal]=True. Can I do this? I have looked in help and here
in the newsgroups and I'm not seeing it. Seems like if Excel can do it,
Access MUST be able to.

Thanks very much for your help.
 

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