Based on the condition of 'Deposit' and category 'OUTFLOWS', i want to reverse the sign in CHECKINGACCOUNT_V1 for transamount to be negative otherwise keep it positive However when I execute the query it does nothing to the sign. It is as though it is ignoring the CASE statement. See SQL below (SQLtests OK but results not what I expected)
Code: Select all
select transcode,categid, subcategid
, CASE categid WHEN '17' and transcode = 'Deposit' then -1*transamount else transamount end as actuals
from checkingaccount_v1
where subcategid not in ('-1', '98','99');
See results spreadsheet attached. The shaded area was expected to have negative amounts but that was not the case!
I would be grateful if anybody can guide me on how to get this running properly.
Thanks
Vara