Hi,
Use
Stuff or
Coalesce to get the same output that you want.
Please try with below query using STUFF.
SELECT DISTINCT empcode,
STUFF((SELECT distinct ',' + Cast(Day([Date]) AS varchar)
FROM [Table] p1
WHERE p.empcode= p1.empcode
FOR XML PATH(''), TYPE
).value('.', 'NVARCHAR(MAX)')
,1,1,'') as DateConcate
FROM [Table] p;
Please let me know if you have any concern or query on this or if you need more information on this.
Thanks