Quick addition to a Query Statement

paulS30berks

Registered User.
Local time
Today, 13:20
Joined
Jul 19, 2005
Messages
116
I have a query statement:

Final Tax Free Amount: IIf(Left([Final Tax Code],1)="k",Right([Final Tax Code],Len([Final Tax Code])-1)*-10-9,Val([Final Tax Code])*10+9)

If I wanted to include: If final tax code = BR or NT then = 0. How can I add this to this statement?

thanks
 
Paul,

You can nest the IIf statement, but your original submission has
too many clauses. Should be: IIf(Condition, TrueValue, FalseValue)

Indented for readability:

Code:
Final Tax Free Amount: IIf([Final Tax Code] In ("BR","NT"), 
                           0, 
                           IIf(Left([Final Tax Code],1) = "k",
                               Right([Final Tax Code],
                               Len([Final Tax Code]) - 1) * -10-9,  <-- ???
                               Val([Final Tax Code])*10+9))         <-- Extra clause

Wayne
 

Users who are viewing this thread

Back
Top Bottom