Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can you spot the syntax error?! 1

Status
Not open for further replies.

raisinchicky

Technical User
Oct 5, 2005
6
GB
I've been puzzling over this all evening! I'm sure its incredibly simple, but Access is telling me I have a syntax error (comma) in the following statement:

Code:
IIf([BusinessUnit]="Registrations",(IIf([TotalCalls]=0,0,[Total Plans]/[TotalCalls])>0.012,"Over","Under"),0) AS ConvTarget

Any help would be hugely appreciated!!

Tanya
xoxox
 
IIf([BusinessUnit]="Registrations",(IIf([TotalCalls]=0,0,[Total Plans]/[TotalCalls])>0.012),0) AS ConvTarget

I removed the Over and Under.. you can only return one thing from an IIF Call.. Unless you wanted to do another IIf call.. in which case:

IIf([BusinessUnit]="Registrations",(IIf([TotalCalls]=0,0,IIf([Total Plans]/[TotalCalls])>0.012,"Over","Under")),0) AS ConvTarget
 
Perhaps this ?
IIf([BusinessUnit]="Registrations", IIf(IIf([TotalCalls]=0,0,[Total Plans]/[TotalCalls])>0.012,"Over","Under"), "N/A") AS ConvTarget

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
You can only have three arguments per IIf, you have 5 in the nested IIf.


-----------------------------
expr : Required. Expression you want to evaluate.
truepart : Required. Value or expression returned if expr is True.
falsepart : Required. Value or expression returned if expr is False.
 
Thankyou all for your help!! I swear, I'd been staring at the daft thing so long I'd almost gone blind, no wonder I didn't spot that I didn't have enough IIf's!

love,
t xxx
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top