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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Too Few Parameters

Status
Not open for further replies.

hedidit

Technical User
Jul 21, 2005
142
0
0
GB
Hi all, can someone please point out whats wrong with this where clause?

Code:
WHERE (((IIf(IsNull([revisedduedate])=True,[duedate],[revisedduedate]))=#01/01/2006# AND ReportMAP.Priority='H' ORDER BY Clients.ClientName, DetailsofPlan.PlanCode, ReportMAP.RecNum

My sql runs fine until i add this where clause on the end and then it gives me a 'Too Few Parameters. Expected 2. error! Using MS access database.

Cheers in advance.
 
Looks like it is a parens problem, in particular you have 5 opening parens and 3 closing ones

Code:
WHERE [!]((([/!]IIf[!]([/!]IsNull[!]([/!][revisedduedate][!])[/!]=True,[duedate],[revisedduedate][/!]))[/!]=#01/01/2006# AND ReportMAP.Priority='H' ORDER BY Clients.ClientName, DetailsofPlan.PlanCode, ReportMAP.RecNum

[small]"Mom........MEATLOAF!!!! DANG!!!![/small]
<.
 
Hi MonkSnake,

I'm afraid the date part does have an extra two )around it... sorry typo on my part...

 
It is probably still a problem regarding how you're using your parentheses. Can you post back with the correct version that you're using so that we can track from there? Typically, it means that one of your formulas has a problem, often related to parentheses not being properly placed.

------------------------------------------------------------------------------------------------------------------------
"Men occasionally stumble over the truth, but most of them pick themselves up and hurry off as if nothing ever happened."
- Winston Churchill
 
Yeah I was looking at it and thinking that the first parameter of your IIf statement needed parens around it, (the entire isNull statement)

[small]"Mom........MEATLOAF!!!! DANG!!!![/small]
<.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top