>I have a stored procedure which is invoked by an IF statement, shown below:
>
>IF INLIST(SUBSTRC(mainkey,AT('*',mainkey),8),'*AW2002*','*SS2002*')
>
>The if statement works great if any of my records contain 'AW2002' or 'SS2002'.
>What I would like to do is now reverse the statement so that if it does equal AW2002 or SS2002 then the stored procedure will not work!! I have tried:
>
>IF INLIST(!SUBSTRC(mainkey,AT('*',mainkey),8),'*AW2002*','*SS2002*','*AW2003*'
>
>&
>
>IF not INLIST(SUBSTRC(mainkey,AT('*',mainkey),8),'*AW2002*','*SS2002*','*AW2003*'
>
>This does not work, does anybody have any ideas please?
Your Inlist() function does not appear to have a closing parenthesis - did you just accidentally miss this on both lines above? FYI: Using Not should do the trick, though you sometimes need to add additional parenthesis e.g.
If Condition1 And Condition2
Would become
If Not (Condition1 And Condition2)
censored.