Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Adding data into a VIEW with CASE and PIVOT
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

United Kingdom
1 Posts

Posted - 02/22/2013 :  09:30:22  Show Profile  Reply with Quote
I've inherited a very complicated-looking view which uses CTE, CASE and PIVOT and I need to include some additional data. Multiple rows with data in one column, VisitType, is being split by way of a case statement and then pivoted across 8 columns with each containing the date of the visit.

In another related table I have a column ImageType and each row can contain either 1, 2 or 3 to record which images were taken at each visit. Is it possible to concatenate this image data with those dates, so that column 'Visit 1' would contain '2013-02-22 1,2,3' to show that on this date 3 images were taken?

Only been working with SQL Server for a week so any help would be greatly appreciated.

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 02/22/2013 :  12:11:27  Show Profile  Reply with Quote
You want us to help with code that you did not post?

Go to Top of Page

Very Important crosS Applying yaK Herder

52326 Posts

Posted - 02/23/2013 :  02:32:45  Show Profile  Reply with Quote
sounds like this is what you're after

SQL Server MVP

Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000