multiple criteria If-Then-Else embedded in Access query

Okay, I have a field named "Comments" that I've pulled into an access query.  I need to embed the following if-then-else statements without them overriding one another.  I tried embedding one if-then-else, then querying that query with the other if-then-else and I lose the results of the first query.

I need the If-then-else to say:

Comments: IIf([Status]="LR" And [Wash Date]<[UnitStatusDate],"Lease Returned on" & " " & [UnitStatusDate] & " " & " - Prior to Wash Date")

and

IIf([Status]="Sell" of "SellF" or "SellP" or "Sold1" or "Sold2", And [Wash Date]<[UnitStatusDate],"Truck placed on Sell List on" & " " & [UnitStatusDate] & " " & " - Prior to Wash Date")

This is urgent.  Help!



   
jcuniglioAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Can there be more values for Status than LR, Sell, Sellf, SellP, Sold1 or Sold2? If not, then just use the first IIF statement with this exception:

IIf([Status]="LR" And [Wash Date]<[UnitStatusDate],"Lease Returned on" & " " & [UnitStatusDate] & " " & " - Prior to Wash Date", ],"Truck placed on Sell List on" & " " & [UnitStatusDate] & " " & " - Prior to Wash Date")

If there CAN be other values, then try something like this:

IIf([Status]="LR" And [Wash Date]<[UnitStatusDate],"Lease Returned on" & " " & [UnitStatusDate] & " " & " - Prior to Wash Date",IIf([Status]="Sell" of "SellF" or "SellP" or "Sold1" or "Sold2", And [Wash Date]<[UnitStatusDate],"Truck placed on Sell List on" & " " & [UnitStatusDate] & " " & " - Prior to Wash Date"))


0
jcuniglioAuthor Commented:
Well, we're moving in the right direction, however, it's populating EVERY field with the second 'else', regardless of the value of 'Status'.  Yes, there CAN be other values.
0
Rey Obrero (Capricorn1)Commented:


IIf([Status]="LR" And [Wash Date]<[UnitStatusDate],"Lease Returned on" & " " & [UnitStatusDate] & " " & " - Prior to Wash Date",IIf([Status]="Sell" or [Status]= "SellF" or [Status]="SellP" or [Status]="Sold1" or [Status]="Sold2" And [Wash Date]<[UnitStatusDate],"Truck placed on Sell List on" & " " & [UnitStatusDate] & " " & " - Prior to Wash Date"))
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Rey Obrero (Capricorn1)Commented:

IIf([Status]="LR" And [Wash Date]<[UnitStatusDate],"Lease Returned on" & " " & [UnitStatusDate] & " " & " - Prior to Wash Date",IIf([Status]="Sell" or [Status]= "SellF" or [Status]="SellP" or [Status]="Sold1" or [Status]="Sold2" And [Wash Date]<[UnitStatusDate],"Truck placed on Sell List on" & " " & [UnitStatusDate] & " " & " - Prior to Wash Date","Whatever"))
0
jcuniglioAuthor Commented:
You are a God and genius amongst simple men.  Thanks!!!!!!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.