Iif statement again

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

As you can see I am new to Access
I want to make an Iif statement in a query
Iif The lot is a 6 then Cost=Price*Portion*Weight
if not than Cost=Pric
I think if I can get help on this it will solve other problems I am havin

Thanks much for your help
 
Cost: Price * IIf([Lot]=6, Portion * Weight, 1)
I don't like to hard code values like "6" into expressions. What happens if
you get a new lot that uses the same logic? Do you want to go back to your
expression and add another Lot number. If possible, this type of "business"
logic should be maintained in tables.
 
Thank you very much Mr. Hookom it worked beautifully. "6" is the only lot that is different and will always be so It will work fin
Thanks again
 
Back
Top