Thanks for that Gail
I've brought back one set of records using each method and this is what I'm getting for the Response field....
My CTE:-
4 Cant change status to final
Cant change status to final Procedure needs removing
The XML Path method:-
UNFIN,4 ,CANT CHANGE STATUS TO FINAL ,PROCEDURES NEED REMOVING,
I can remove the final comma easily enough, but I'm not sure where the UNFIN and the "&xOD;" bit's are coming from (I'm assuming "&xOD;" is a carriage returns, line feed or similar).
Any ideas?
::edit::
Forgot to include my updated code:-
select
mult1.VisitID
,mult1.AbstractID
,(select
Response + ','
from
[livedb_daily].[dbo].[AbsProjectsQueriesMultCs] mult2
where
mult2.VisitID=mult1.VisitID
and mult2.AbstractID=mult1.AbstractID
order by
mult2.VisitID
,mult2.AbstractID
for xml path ('')) as overall
from
[livedb_daily].[dbo].[AbsProjectsQueriesMultCs] mult1
where
mult1.VisitID='RA0-20120603025910735'
and mult1.[Query]='Additional Notes'
group by
mult1.VisitID
,mult1.AbstractID