Hey guys I am working on this query and I keep getting the output I want all in one line and I'd like it to be separated
the code is as follows:
SELECT e.clientcode,
clientname,
staffcode AS ServiceEM,
debttrandate AS InvoiceDate,
debttranrefalpha AS InvoiceNbr,
dd.feenarrative AS narrative,
dd.amount AS BillAmount
FROM tblengagement e
INNER JOIN tblclientservices cs ON cs.contindex = e.contindex
INNER JOIN tblstaff s ON s.staffindex = cs.servmanager
INNER JOIN tbltrandebtor d ON d.contindex = e.contindex AND d.contindex = cs.contindex
INNER JOIN tbltrandebtordetail dd ON dd.debttranindex = d.debttranindex AND dd.debtdetservice = cs.servindex
WHERE dd.debtdetservice = 'taxcomp' AND
d.DebtTranType=3 and
DebtTranDate between 'jan 1 2014' and 'oct 31 2014'
and DebtTranRefAlpha='72598'
right now column dd.feenarative
gives an output such as Aaa....BBB...CCC...DDD
all in one line on the first row instead of it displaying
aaa
bbb
ccc
ddd
I know I need to do some sort of Carriage Return but I have tried everything such as adding declare @crlf varchar(2000)
before the select and
CAST(+dd.FeeNarrative as varchar(2000)),+ ' ' +Cast( dd.FeeNarrative as varchar(2000)) + ''
in the select but I doesn't accomplish it...I played around with it all different ways.