Hello ,
I want to display the roles for the same employee comma separated .
Hi Rahul,
You will need to have a DataAction instead of an aggregate in order to have an advanced query with the STUFF SQL Server command (which concatenates strings).
OML in attachment with your requirements.
Hope it helps.
Regards,João
Hello João Marques ,
Thank You for your help and support : )
Regards ,
Rahul Gupta
You need to use advance sql for this.
see below document-
https://stackoverflow.com/questions/21760969/multiple-rows-to-one-comma-separated-value-in-sql-server
SELECT ID ,STUFF((SELECT ', ' + CAST(Value AS VARCHAR(10)) [text()] FROM @Table1 WHERE ID = t.ID FOR XML PATH(''), TYPE) .value('.','NVARCHAR(MAX)'),1,2,' ') List_Output FROM @Table1 t GROUP BY ID Hope this will hepl you. Regards Rahul
SELECT ID ,STUFF((SELECT ', ' + CAST(Value AS VARCHAR(10)) [text()] FROM @Table1 WHERE ID = t.ID FOR XML PATH(''), TYPE) .value('.','NVARCHAR(MAX)'),1,2,' ') List_Output FROM @Table1 t GROUP BY ID
Hope this will hepl you.
Regards
Rahul