Iif statement again

R

RAB

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
 
D

Duane Hookom

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.
 
R

RAB

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top