GRChandrashekar
asked on
Ouput integer as postive
SELECT BILLDATE,
MONTHLYBILL_ID,
BALANCEAMOUNT,
CASE WHEN BALANCEAMOUNT < 0 THEN 'C' ELSE 'D' END AS DEBITCREDIT
FROM MONTHLYBILL
WHERE BILLDATE = NVL (TO_DATE ('', 'DD/MM/YYYY'), BILLDATE)
AND MEMBER_ID = 4
In the above query, I am displaying all negative values as C and positive values as D.
But I dont want negative sign to appear in output
If I do ABS(Balanceamount) then case becomes D if integer is -ve. I want the case to remain as C but show -ve as +ve. How can I do this
MONTHLYBILL_ID,
BALANCEAMOUNT,
CASE WHEN BALANCEAMOUNT < 0 THEN 'C' ELSE 'D' END AS DEBITCREDIT
FROM MONTHLYBILL
WHERE BILLDATE = NVL (TO_DATE ('', 'DD/MM/YYYY'), BILLDATE)
AND MEMBER_ID = 4
In the above query, I am displaying all negative values as C and positive values as D.
But I dont want negative sign to appear in output
If I do ABS(Balanceamount) then case becomes D if integer is -ve. I want the case to remain as C but show -ve as +ve. How can I do this
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window