IIF Syntax Error in Report

Good Afternoon,

I copied the syntax below from a pevious EE question and adaapted it for my own situation, but i've obviously overlooked something:

IIf([TEXT38]="a20",[text48],IIf([TEXT38]="A22",[text48],IIf([TEXT38]="A30",[text50],IIf([TEXT38]="A50",[text53],IIf([TEXT38]="A60",[text54],""])))))

The syntax error:

"Syntax error (comma) in query expression"

I appreciate any assistance you can provide.

thank you

aasikolo
aasikoloAsked:
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.

DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
Try this:

IIf([Text38] = "a20", [text48], IIf([Text38] = "A22", [text48], IIf([Text38] = "A30", [text50], IIf([Text38] = "A50", [text53], IIf([Text38] = "A60", [text54], "")))))

mx
0
aasikoloAuthor Commented:
mx:

Same syntax error.

thanks

aasikolo
0
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
Humm , it compiles on my machine.

Here

,[text54],""])))))

There is an extra bracket  ]

I removed that, and it compiled
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

aasikoloAuthor Commented:
IIf([Text38] = "a20", [text48], IIf([Text38] = "A22", [text48], IIf([Text38] = "A30", [text50], IIf([Text38] = "A50", [text53], IIf([Text38] = "A60", [text54],"")))))

no extra bracket... no compile

Could this be a library issue?
0
TextReportCommented:
Firstly you need an = in front of the IIF()
Secondly I would use Switch() as it pairs your condition and return rather than nesting IIF()'s

=Switch([TEXT38]="a20",[text48],[TEXT38]="A22",[text48],[TEXT38]="A30",[text50],[TEXT38]="A50",[text53],[TEXT38]="A60",[text54],True,Null)

Cheers, Andrew
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
aasikoloAuthor Commented:
an equals sign.  Don't I feel silly
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.