返回列表 发帖
You can also use MIN for this one:


EOS = YoS*Sal - MIN(5,YoS)*(Sal/2)

Gives you a salary for each year of service, but removes 1/2 of it for each of the first five years.

No IF, AND, or BUTs.


You will need IF if the rules mean that a 6 year worker gets 6 years at full salary and not 5 years of half salaries and 1 year at full (though you might be able to substitute a boolean (YoS<=5) for the MIN term and have it work like that)



Edited 1 time(s). Last edit at Saturday, April 30, 2011 at 09:44AM by bchadwick.

TOP

返回列表