Switch error

Experts, I have a wrong number of arguments in this SWitch statement:

PastDueOrPendingSWITCH: Switch([Due Date Per Docs]<Date() & Isnull([Completed]),"Past Due", IsNull([Completed] and [Due Date Per Docs]<Date(),"Pending", IsNotNull([Completed]),"Completed",1=1,"Other")

Not sure if "IsNotNull" is the issue.  I also tried Nz([Completed]),"")="".  I imagine it is a comma or a parenth but I dont see it.

thank you
pdvsaProject financeAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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.

Dale FyeOwner, Developing Solutions LLCCommented:
I like to break these up into pairs on separate rows, then delete the carriage returns.  It looks like you have the correct # of argumens, but need to use the AND in the first comparison, not the &

PastDueOrPendingSWITCH: Switch(
[Due Date Per Docs]<Date() AND Isnull([Completed]),"Past Due",
IsNull([Completed] AND [Due Date Per Docs]<Date(),"Pending", IsNotNull([Completed]),"Completed",
Gustav BrockCIOCommented:
Try with:

PastDueOrPendingSWITCH: Switch([Due Date Per Docs]<Date() And [Completed] Is Null,"Past Due", [Due Date Per Docs]>=Date() And [Completed] Is Null,"Pending", [Completed] Is Not Null,"Completed", True,"Other")

Note that the two first tests were identical. That is probably not what you are after.


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
pdvsaProject financeAuthor Commented:
Thank you Gustav.   Thanks for pointing out that the first 2 tests were identical.  

Fyed:  seems there was a wrong number of arguments
Gustav BrockCIOCommented:
You are welcome!

Dale FyeOwner, Developing Solutions LLCCommented:
I was missing a ), but also didn't pick up on the fact that the first two were identical until after Gustav mentioned that.
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.