Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IIF with IsNull

Status
Not open for further replies.

canett

Technical User
Jan 22, 2006
18
BG
I have a good IIF Function based on the availablity of a field, which sometimes might be 0 and sometimes there is nothing in it.My function works, if the filed cartons is either 0 or > 0. However, my function does not work if the field cartons is blank, i.e. there is no 0 in it.
How an I improve my Iif function so to include both three cases : when it is Null, hen it is 0 and when it >0 ?

NetPrice: IIf([cartons]>0;[ddp]*[cartons]*[size]*[pack];IIf([cartons]=0;[ddp]*[size]*[quantity];0))
 
NetPrice: [ddp]*[size]*IIf(nz([cartons],0)>0;[cartons]*[pack];[quantity])
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top