The below SQL strings together data from multiple rows, separated by a comma. I need to separate those values with carriage return. I can't make it work with suggestions I'm finding on the web. Any ideas?
SELECT DISTINCT p1.RequestLink,
CONVERT(VARCHAR(255),REPLACE((SELECT CONVERT(VARCHAR(30),ApprovalType) + ',' AS 'data()'
FROM Approval p2
WHERE p2.RequestLink = p1.RequestLink
AND (PersonLink IS NOT NULL)
ORDER BY p2.RequestLink
FOR XML PATH('')) + '$', ',$', '')) AS Type
FROM Approval p1
GROUP BY RequestLink
SELECT DISTINCT p1.RequestLink,
CONVERT(VARCHAR(255),REPLACE((SELECT CONVERT(VARCHAR(30),ApprovalType) + ',' AS 'data()'
FROM Approval p2
WHERE p2.RequestLink = p1.RequestLink
AND (PersonLink IS NOT NULL)
ORDER BY p2.RequestLink
FOR XML PATH('')) + '$', ',$', '')) AS Type
FROM Approval p1
GROUP BY RequestLink