How to display data in linear mode
This example is found here
I have a report that I want to create will show me information like the following:
Account ID, DateEntered, DateFirst contact was made, Dealt by, Date 2nd contact was made, Dealt by ....
However all this information is in one table, but the information comes like this (see example in link)
Now I would like to see the data like this linearly:
123 12-04-07 John 14-04-07 Mary 15-06-07 Cait
However, different accounts will have different amounts of data in it so some might have 5 rows, which might have ten?
I would like to display data linearly so that each row is unique. In the example case, the only identifier would be the account ID. My personal scenario is slightly different in that I have data in multiple tables, but you can easily join them to get similar output in the example above. Where I am having trouble is you make the data linear so that each row is unique and doesn't repeat itself for every difference.
Can this be done?
a source to share
You haven't specified which version of SQL Server you are using, or the row count is fixed or not for each account ID. The information above limits which solution you need to use and these below will help you get what you want or answer with more information.
http://www.simple-talk.com/community/blogs/andras/archive/2007/09/14/37265.aspx http://sqlserver2000.databases.aspfaq.com/how-do-i-create-a -cross-tab-or-pivot-query.html http://www.mssqltips.com/tip.asp?tip=1019
a source to share