SELECT
b_Name+' | '+Entity+' | '+cast(A_Date as varchar) as [top] -- Colum
,b_Name -- Rows
,[Task_Category] -- Rows
,[Fcn_Name] -- Rows
,[Task] -- Rows
,[Task_ID] -- Rows
,[Owner] -- Rows
,[RAG_Status] -- Rows
FROM [Task]
I'm trying to make the concatenated [TOP] into column headings but leave the rest into rows. I'm still learning SQL so, please be patent with me. lol
SELECT *
FROM
(
SELECT
b_Name+' | '+Entity+' | '+cast(A_Date as varchar) as [top] -- Colum
,b_Name -- Rows
,[Task_Category] -- Rows
,[Fcn_Name] -- Rows
,[Task] -- Rows
,[Task_ID] -- Rows
,[Owner] -- Rows
,[RAG_Status] -- Rows
FROM [IntegrationDBdev].[dbo].[Task_Acquisition]
) AS SourceTable PIVOT(AVG(task) FOR ????
IN(
??????
) ) AS PivotTable;
I've tried the above but not sure what to put in the pivot