errol
CASE WHEN trunc({today})-{trandate} between 61 and 90 then {amountremaining} * (CASE WHEN {type} IN ('Payment', 'Credit Memo') THEN -1 ELSE 1 END) END