Hello all, I have been struggling with the PIVOT, but can't get it to work. I don't even know if I should be using it. I'm trying to show as a table or view so I can display the results in a datagrid view.I need my VStation names in columns, they are now rows.I need my times still has rows. So I have times on left hand sided vertical, and station names as my columns. And then values as the intersect of OPEN or a name is placed in.It's to be able to look at schedule quickly to see what stations are open and the ones that are booked for the day.The number of Vstations will vary, but I have a enabled checked in the table to check if I need it or not.I supplied some code below, not exactly what I have, but the basics. It's enough to explain what I need to do, and simple enough so it's not confusing. I'm sure I'll have questions after this post.Thanks for all the help!RudyCREATE TABLE [dbo].[tblTime] (Timeid int identity(1,1), [Time] [nchar](10), [TimeEnabled] [bit]) INSERT INTO tblTime (Time, TimeEnabled)SELECT N'10:30 AM', 1UNION ALLSELECT N'10:35 AM', 1UNION ALLSELECT N'10:40 AM', 1UNION ALLSELECT N'10:45 AM', 1UNION ALLSELECT N'10:50 AM', 1CREATE TABLE [dbo].[tblVis]( [VisID] [int] IDENTITY(1,1), [VisName] [nvarchar](50)) INSERT INTO tblVis (VisName)SELECT 'VStation1'UNION ALLSELECT 'VStation2'UNION ALLSELECT 'VStation3'UNION ALLSELECT 'VStation4'UNION ALLSELECT 'VStation5'UNION ALLSELECT 'VStation6'UNION ALLSELECT 'VStation7'CREATE TABLE [dbo].[tblInm]( [InmID] [int] IDENTITY(1,1), [InmName] [nvarchar](50)) INSERT INTO tblInm (InmName)SELECT 'IStation1'UNION ALLSELECT 'IStation2'UNION ALLSELECT 'IStation3'UNION ALLSELECT 'IStation4'UNION ALLSELECT 'IStation5'UNION ALLSELECT 'IStation6'UNION ALLSELECT 'IStation7'CREATE TABLE tblSchedule([SchedID] [int] IDENTITY(1,1),[VisID] [int],[InmID] [int],[SchedDate] [nvarchar](50),[SchedTime] [nvarchar] (50))INSERT INTO tblSchedule (VisID, InmID, SchedDate, SchedTime)SELECT 1, 2, '04/08/2011', '10:35 AM'UNION ALLSELECT 6, 3, '04/08/2011', '10:35 AM'UNION ALLSELECT 4, 5, '04/10/2011', '10:50 AM'--THIS IS TO FIND OUT WHAT TIME SLOTS ARE OPEN AND WHAT TIMES SLOTS ARE FILLEDSELECT tblTime.Time, tblVis.VisName, tblInm.InmName, tblSchedule.SchedDateFROM tblSchedule LEFT OUTER JOIN tblInm ON tblSchedule.InmID = tblInm.InmID LEFT OUTER JOIN tblVis ON tblSchedule.VisID = tblVis.VisID LEFT OUTER JOIN tblTime ON tblSchedule.SchedTime = tblTime.TimeWHERE (tblSchedule.SchedDate = RIGHT(CONVERT(varchar(50), GETDATE(), 101), 12))UNION ALLSELECT TIME, 'OPEN', 'OPEN', '01/01/1900' from tblTime WHERE not exists (select 1 from tblSchedule where tblSchedule.SchedTime = tblTime.Time AND tblSchedule.SchedDate = RIGHT(CONVERT(varchar(50), GETDATE(), 101), 12)) AND tblTime.TimeEnabled = 'true'--DROP TABLE tblInm--DROP TABLE tblSchedule--DROP TABLE tblVis--DROP TABLE tblTime