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

How do I write a IIf statement with multiple criteria

Status
Not open for further replies.

Stayingahead

IS-IT--Management
Dec 20, 2004
8
US
I am writing a query that separates Cash, Expenses and Revenue in separate columns. Each of these has its own [Object_Code]for each [Amt_Posted]. The object codes I have been useing are:
100 - Cash
600 - Expenses
400 - Revenues (But I also have other Revenue codes - 401, 402, 403, 410, 411, 420, 440, 450)

THe IIF statement I wrote for the Cash and Expenses works well, but I'm having problems writing one for the Revenues that will place all of the reveneues in the same column.

Here is the IIf statement I use for the expenses.
Expenses:IIF([Obect_Code]=600,[Amt_Posted],0)

How do I modify it to include all of the 400 series Revenue objects?
 
Revenue: IIf(([Object_Code]\100)=4,[Amt_Posted],0)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
PH
I tried the modified statement and it doesn't work. I am working with a link table and our Central Office has set the [Object_Code] up as a "text" field and they won't change that.

Any other ideas?
 
Revenue: IIf(Left([Object_Code],1)="4",[Amt_Posted],0)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks PH

I was making it too hard. After you think about it, this makes sense. Thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top