Have a subform that I am trying to set the value of Tax based on a plant field and useage. If the Plant is 3 then tax is 5% for everthing. If Plant is 1 or 2 then tax is 7% on non production and 0% on production.
Here is the code for the Tax field.
@If(Type3 != "Plant#3") & @If(Prod != "Production");@Sum(SubTotal * 0.07);@If(Type3 = "Plant#3");@Sum(SubTotal * 0.05);0
Software/Hardware used:
lotus notes 6.5.4
ASKED:
October 6, 2009 2:17 PM
UPDATED:
October 9, 2009 1:50 PM
Actually, I don’t think you need to specify the second @If (and I don’t think the code above calcs the tax correctly); this should work:
@If(Type3 = “Plant#3″; SubTotal * 0.05; Prod = “Production”; 0; SubTotal * 0.07 )
Stiletto is right; I had a logic error (the first !=). This, or Stiletto’s version would be correct.
@If(Type3 = “Plant#3″; SubTotal * 0.05; @If(Prod != “Production”; SubTotal * 0.07; 0))