If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Display Modes |
#11
|
|||
|
|||
What's wrong with my IIF Statement?
You might also consider the Switch() function. Saves the problem of having
to match multiple parenthesis. PressureSco Switch([Pressure]=80, 0,[Pressure]=100, 2,[Pressure]=120, 4, [Pressure]=140, 6, True, 8) PipeMaterialSco Switch([Pipe Material]="cast iron", 6,[Pipe Material] ="Ductile", 4, [Pipe Material]="PVC" or [Pipe Material]="HDPE", 2,True, 0) Bob MB wrote: I'm using this expression in my query and it works great: PressureSco IIf([Pressure]=80,"0",IIf([Pressure]=100,"2",IIf([Pressure]=120,"4",IIf([Pressure]=140,"6",IIf([Pressure]=141,"8"))))) However, the following is not working: PipeMaterialSco IIf([Pipe Material]="cast iron","6",IIf([Pipe Material]="Ductile","4",IIf([Pipe Mterial]="PVC" or "HDPE,"2","0")) Should return scores as: Cast Iron = 6 Ductile = 4 PVC = 2 HDPE = 2 Using Access 2007. -- Message posted via http://www.accessmonster.com |
|
Thread Tools | |
Display Modes | |
|
|