Link to home
Start Free TrialLog in
Avatar of thandel
thandel

asked on

Proper syntax for IIF using OR

If have the following formula in a text box:

=IIf(DateAdd("yyyy",1,[LastApmnt])<Date() And (Not IsNull([ContactType]) And ([ContactType]<>"None" Or [ContactType]<>"Trials")),"EXPIRED","")

I am trying to check if a date from [LastApmnt] is more than a year old and if so put up EXPIRED only when [ContactType] is not null and not equal to None or Trials.  

I can get a formula working  when only checking for trials or none but not both.  What am I doing wrong?

ASKER CERTIFIED SOLUTION
Avatar of bluelizard
bluelizard
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of puppydogbuddy
puppydogbuddy

try this:
=IIf(DateAdd("yyyy",1,[LastApmnt])<Date() And Not IsNull([ContactType]) And ([ContactType]<>"None" Or [ContactType]<>"Trials"),"EXPIRED","")
Avatar of thandel

ASKER

Sorry PuppyDog, your solution didn't work.  Thanks to all for a quick response.