> SELECT Marginal from marginalTaxRates where AGI BETWEEN AgiLo AND AgiHi
Has anyone used LOOKUP for this?
> SELECT Marginal from marginalTaxRates where AGI BETWEEN AgiLo AND AgiHi
Yeah, BETWEEN is the way to go with that SETUP.
Except "infinity" is not a number, but assuming this is for the real
world, noone will ever have the amaximum capacity of the field.
Just a note. If AgiLo is always (zero or ) one more than AgiHi, AgiHi
is inferred, and unneeded.
SELECT MAX(Marginal) from marginalTaxRates where AGI >=AgiLo
Of course >= is wasteful. :) Instead, it could be a field (Limit) whose
values are 0, then all the AgiHis besides "infinity".
SELECT MAX(Marginal) from marginalTaxRates where AGI > Limit
B.
Rajah - 12 Jul 2006 23:25 GMT
> SELECT MAX(Marginal) from marginalTaxRates where AGI >=AgiLo
Yes, this would work if we always have a progressive system, where
Marginal rates are increasing. Unfortunately, I cannot make that
assumption with the real data.
You do have an excellent observation about the problem of
non-continguous data. After all, it is possible to have a
dollars-and-cents AGI that falls between the cracks.