please I need a sql command similar to decode in oracle becuase am getting an error when i verified as an sql command.
below is my code which, please help by correting the problem
SELECT dbo.Trans_Head.Doc_Date, dbo.Trans_Head.Document_No, dbo.Trans_Head.Account_Type, dbo.NewAccount.Surname + '' + dbo.NewAccount.First_Name AS Account_Holder, dbo.Trans_Details.Account_Name,SUM(NVL(DECODE(dbo.Trans_Details.Trans_type, 'DR', dbo.Trans_Details.Amount), 0)) Payemnt,
SUM(NVL(DECODE(dbo.Trans_Details.Trans_type, 'CR', dbo.Trans_Details.Amount), 0)) Receipts
FROM dbo.NewAccount INNER JOIN dbo.Trans_Details ON dbo.NewAccount.Account_no = dbo.Trans_Details.Account_No INNER JOIN
dbo.Trans_Head ON dbo.Trans_Details.Document__no = dbo.Trans_Head.Document_No INNER JOIN
dbo.Accounts ON dbo.NewAccount.Account_Type = dbo.Accounts.Account_Type