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

IIf statement syntax problem

Status
Not open for further replies.

simon551

IS-IT--Management
Joined
May 4, 2005
Messages
249
Hi. I'm having a hard time getting the syntax of this multi-IIf statement correct. If you can help me I'd really appreciate it.

it's giving me an error message of: 'Wrong number of arguments used with query expression.'

Code:
SELECT  tblMembershipsProcessed.processDate, tblMembershipsProcessed.amountPaid, Month([processDate]) AS processMonth, Year([processDate]) AS processYear, 

IIf([processYear]=2008,IIf([processMonth]<=2,Round(([AmountPaid]/12),2),
IIf([processYear]=2007,IIf([processMonth]>=2,Round(([AmountPaid]/12),2),0),0),0),0) AS [Feb 08]

FROM tblMembershipsProcessed

Thanks!
 




Code:
IIf([notified]=2007,IIf([notified]>=2,Round(([notified]/12),2),0),0)),0)  AS [Feb 08]
or
Code:
IIF([ProcessDate]>=#2/1/2007# and [ProcessDate]<=#2/29/2007#,Round(([AmountPaid]/12),2),0)


Skip,

[glasses]Did you hear what happened when the OO programmer lost his library?...
He's now living in OBJECT poverty![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top