SELECT [ar-open-tr].[Trans-amt],
Case when [ar-open-tr].[Trans-amt] > 0 then [ar-open-tr].[Trans-amt] END AS Credit,
Case when [ar-open-tr].[Trans-amt] < 0 then [ar-open-tr].[Trans-amt] END AS Debit
FROM [ar-open-tr]
You can include a table alias instead of [ar-open-tr] for more clarity SELECT T1.[Trans-amt], Case when T1.[Trans-amt] > 0 then T1.[Trans-amt] END AS Credit, Case when T1.[Trans-amt] < 0 then T1.[Trans-amt] END AS Debit FROM [ar-open-tr] T1
What about scenarios where [ar-open-tr].[Trans-amt]=0?
SELECT T1.[Trans-amt], Case when T1.[Trans-amt] >= 0 then T1.[Trans-amt] END AS Credit, Case when T1.[Trans-amt] < 0 then T1.[Trans-amt] END AS Debit FROM [ar-open-tr] T1