MTA is based on a parameter (= 6500 in this case) @MaxTradeAmt
TradeAmount is from transactions for various accounts.
If TradeAmount > parameter MTA the it should be set to 0 and add up with any other tradeamounts for the [Year] (my column head).
Inconsistent. What I find is if more than one TradeAmount in a given year is greater that 6500 I get an Error.
If I only have 1 TradeAmount that exceeds 6500 the result is accurately shown as 0.
Anytime all TradeAmounts are less less that 6500 they Sum correctly.
Any thoughts would be appreciated.