When exporting data to Excel the character “&” is being shown as “&”. This is done by the button “Exporteren” in the toolbar of the Windows GUI.
Can this be fixed please?
Best answer by Anne Buit
This does resolve the problem with the ampersand. However, you might run into a few more problems with other characters being escaped, such as greater-than and lower-than.
The following solution would prevent any xml escaping from ending up in the final text:
(SELECT x.y.value('.', 'NVARCHAR(MAX)')
SELECT ', ' + x.naam
FROM oplosser o
JOIN organisatie x ON x.guid = o.organisatie_guid
WHERE o.melding_guid = t1.guid
ORDER BY x.naam
FOR XML PATH (''), type
), 1 , 2 , '')
Edited: casing of .value