Formula for miscellaneous cost in invoice form

SUGGESTED

I am trying to insert miscellaneous costs in invoice totals but my formula is not working. I am using OEINVD table and my formula is:

IF {OEINVD.MISCCHARGE} = "UPS" THEN {OEINVD.EXTINVMISC} 

Any help is highly appreciated