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!

Help please! using IIF

Status
Not open for further replies.

Spyridon

Technical User
Jun 27, 2003
45
US
I have a field on a report that needs to use an IIF statement, I need it to say something like this:

IIF([SalesType]= 1****or 101, or 201****,1,0)

and in another place:

IIF([SalesType]>99****AND <199****,1,9)


So basicially the first IIF statement needs to see if SalesType has either the 1, 101, or 201 values and show 1 if any of these are true, and 0 if all of these are false.

On ther Other IIF, it needs to see if the value is greater than 99 and less than 199, and if it is then show 1, if not show 0...


I tried this for the second IIF, but if my SalesType value is a 1, then it shows 1. My SalesType values are 1-16, 100-116, and 200-216.

=IIf([SalesType]>99,1,IIf([SalesType]<199,1,0))


can anyone help me out with my thinking here?


Michael
 
Try
=IIF([SalesType]=1,1,IIF([SalesType]=101,1,IIF([SalesType]=201,1,0)))

and for your second formula:
=IIF([SalesType]<199,IIF([SalesType]>99,1,0),0)

HTH,
Eric
 
iif([SalesType] = 1 or [SalesType] = 101 or [SalesType] =201,1,0)

iif([SalesType] between 99 and 199,1,0)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top