April 6, 2012 at 10:18 am
Is it possible to get the multiple rows of data into one single row in SSRS 2005/2008/2008R2?
For instance, if I've a data that looks like
ID
104
105
106
108
Now, I want it to look like
ID
104,105,106,108
Right now, I just wanted to know if we can do this in any versions of SSRS, using the experssions.
Any guidance is much appreciated.
Thanks.
April 9, 2012 at 7:01 am
This pattern will work in SQL when you are only dealing with a single column of data.
USE AdventureWorks
GO
DECLARE @listStr VARCHAR(MAX)
SELECT @listStr = COALESCE(@listStr+',' ,'') + Name
FROM Production.Product
SELECT @listStr
GO
April 9, 2012 at 7:31 am
For a bit more detail on the subject, please see the following article...
http://www.sqlservercentral.com/articles/comma+separated+list/71700/
--Jeff Moden
Change is inevitable... Change for the better is not.
April 10, 2012 at 1:28 pm
Resolved the issue in TSQL using the CTE.
Thanks everyone for your suggestion and help 🙂
April 10, 2012 at 3:52 pm
sbj1411 (4/10/2012)
Resolved the issue in TSQL using the CTE.Thanks everyone for your suggestion and help 🙂
Would you post your code, please? It might help someone else. Thanks.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply