Equivalent of Excel AND() function?

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

Guest

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.
 
When you use IIf(), you should provide 3 arguments like:

NewVendor:IIf([Category]="Leave" AND [AGoal]=True ,"SL0001-1", Null)
 
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","")
 
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.
 
Back
Top