my current query return the below result
What I need is I have to display date in column header. I know it have to be done using Pivot
Example: if we want to display month in column header then query will be something like..
SELECT [January], [February], [March]
FROM ( SELECT [Month], SaleAmount
FROM Sales
) p PIVOT ( SUM(SaleAmount)
FOR [Month]
IN ([January],[February],[March])
) AS pvt
and I think my resultant query should be look like Pivot ( (Price) FOR [DateVal] IN (What will be here?) )
here is what resultant column should be like
Note: in the result set currently it show December month data, but it can be any month.
Thanks for your help...
Update 4 Ok, now that you posted all your query, and following your comments, you should try this: