IIF statement

  • Thread starter Thread starter RJ
  • Start date Start date
R

RJ

I am trying to create the following "if statement" in MS access
through Expression builder.

=IF(UOM1="KG",Cost*Qty,IF(UOM2="KG",Cost*weight,Cost*quantity))

Even after spending a lot of time, I still can not figure out the
correct statement.

Please help, as this is very important for my job

Rashid
 
You need a double i on the If to make it an iif
=IIF(UOM1="KG",Cost*Qty,IIF(UOM2="KG",Cost*weight,Cost*quantity))
 
Also you refer to QTY in one part of the expression and Quantity in
another part of the expression. Are these two different fields or did
you have a problem while typing the expression.


'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 
Back
Top