May 29, 2018 at 6:35 am
Hello there,
I've attempted to find some information on the XML path and after a few modifications I still wasn't able to adjust this subselect statement to print the '&' symbol instead of the interpreted &. The code is below and any ideas would be great! Thanks🙂
((SELECT ' ' + tddesc
FROM timedesc
WHERE (timecard.tindex = tindex) order by tdline asc FOR XML PATH('')), 2, 1000) AS time_desc
May 29, 2018 at 6:58 am
Those table names look horribly familiar...
Thomas Rushton
blog: https://thelonedba.wordpress.com
May 29, 2018 at 7:03 am
If you change the 'FOR XML' part of your query to look like this:
FOR XML PATH (''), TYPE).value('.','varchar(max)')
you may find what you're looking for.
Thomas Rushton
blog: https://thelonedba.wordpress.com
May 29, 2018 at 9:45 am
ThomasRushton - Tuesday, May 29, 2018 7:03 AMIf you change the 'FOR XML' part of your query to look like this:
FOR XML PATH (''), TYPE).value('.','varchar(max)')
you may find what you're looking for.
Add the text() function to prevent the construct of XML for the output, can half the work.
FOR XML PATH (''), TYPE).value('(./text())[1]','varchar(max)')
May 29, 2018 at 10:27 am
Thanks to both of you for the guidance! Much appreciated.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply