Need help with my query, iif statement.

parkerjallen

Registered User.
Local time
Today, 18:28
Joined
Nov 13, 2012
Messages
18
Code:
Spec: IIF(((pCon1 = "E" or "G" or "I" or "L" or "N" or "O" or "T") AND (pCon2 = "E" or "G" or "I" or "L" or "N" or "T")) OR pMode = "8" OR "9"), .3, .4)

if pCon1 and pCon2 are any of those special letters, or if pMode is 8 or 9, I need a .3. Otherwise, I need a .4.
 
The problem that I'm running into is that I cannot get another result besides .3

Here is my updated code:

Code:
Spec: IIf((([pCon1]="E" Or "G" Or "I" Or "L" Or "N" Or "O" Or "T") And ([pCon2]="E" Or "G" Or "I" Or "L" Or "N" Or "O" Or "T")) Or [pMode]="8" Or "9",0.3,0.4)
 
I haven't tested this, but I think this is closer to what you need.
Code:
SPEC:IIf[COLOR="Red"]([/COLOR]
    [COLOR="Green"]([/COLOR]
     [COLOR="Blue"]([/COLOR][pCon1]="E" Or 
      [pCon1]="G" Or
      [pCon1]="I" Or 
      [pCon1]="L" Or 
      [pCon1]="N" Or
      [pCon1]="O" Or 
      [pCon1]="T"[COLOR="Blue"])[/COLOR]    And 
    [COLOR="Blue"]([/COLOR] [pCon2]="E" Or
      [pCon2]="G" Or
      [pCon2]="I" Or
      [pCon2]="L" Or
      [pCon2]= "N" Or
      [pCon2]="O" Or
      [pCon2]="T"[COLOR="Blue"])[/COLOR]
                    [COLOR="Green"] )  [/COLOR]  Or 
    [COLOR="Green"] ([/COLOR]
     [pMode]="8" Or
     [pMode]="9",0.3,0.4[COLOR="Green"])[/COLOR] [COLOR="Red"])[/COLOR]
 
I haven't tested this, but I think this is closer to what you need.

Thanks. This is the code that actually wound up working:

Edit: NVM, I can't format code windows like you, but the .3 and .4 needed to be moved out a level of parenthesis.
 
To use the code parameters with your expression, you use (without the spaces) [ c o d e ] and [ / c o d e ] or
go to the advanced set up (Advanced button) and use the # option.

I thought it might be a question of parentheses, so colored same to show the associated opening/closing.
Glad you have it resolved.
 

Users who are viewing this thread

Back
Top Bottom