gpsdh
asked on
SQL - Add negative sign if matlfer.xtype = 'INVSUB'
SELECT
CASE matlxfer.xtype
WHEN 'ADDINV' THEN '552'
WHEN 'INVSUB' THEN '551'
END AS ADJUSTMENT ,
matlxfer.xfer_qty
Add negative sign if matlfer.xtype = 'INVSUB'
Data
matlfer.xtype matlxfer.xfer_qty
ADDINV 1
INVSUB 2
ADDINV 3
INVSUB 4
Our database doesn't have negatives, but I need to send data with them and i've tried variables and other things, but none have worked as I wanted. Basically I need it to show as this.
matlxfer.xfer_qty
1
-2
3
-4
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
btw I have an article out there on SQL Server CASE Solutions that has a wompload of CASE examples. Hit the 'Yes' button if it helps you out.
Thanks for the grade. Good luck with your project. -Jim
Thanks for the grade. Good luck with your project. -Jim
ASKER