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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sum of 3 fields; telling the formula that TRUE=5000 in sum formula

Status
Not open for further replies.

Nate1749

Programmer
Nov 1, 2002
204
US
Currently TRUE means that PlacementCompanyCar will equal 5,000; I have in a field and this iff formula works fine..
=(Sum(IIf([PlacementCompanyCar]="yes",5000,0)))

However, I'm trying to do a sum of 3 fields as the grand total, and the other two are actual numbers, so they sum fine, but when I try to add in PlacementCompanyCar it gets tricky.

I'm trying to make the formula say that if it equals yes then add 5000 to the rest of the formula, if it doesn't then add 0. This is what I currently have...

=Sum([PlacementWageSalary]+[PlacementAdditionalCompensation]+(IIf([PlacementCompanyCar]="yes",5000,0)))
 
=[PlacementWageSalary]+[PlacementAdditionalCompensation]+Sum(IIf([PlacementCompanyCar]="yes",5000,0))

Put Nz(fieldname,0) around other fields if there is a chance that they will be Null.

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top