Hi, I almost found the solution to my Pivot problem,s now I don't know how to solve this details:My actual view shows this :Debcode|DebtorName|ItemCode|Year|1|2|3|4|5|6|7|8|9|10|11|12| 100 |Debtor100 | Item1 |2013|0|0|5|0|7|1|3|9|0|02|0 | 1| 100 |Debtor100 | Item1 |2014|2|1|4| 101 |Debtor101 | Item1 |2013|0|0|0|0|0|0|0|0|0| 1| 2| 5| 101 |Debtor101 | Item1 |2014|5|5|0|And I Have to show this :Debcode|DebtorName|ItemCode|201301|201302|... TO CURRENT MONTHThe problem is that this headers will be changing because the view shows from the actual month to 12 past months so, right now the headers are from march 2014 to march 2013 but the next month will be apr 2014 to apr2013 so I don't know how can I control this, my actual code is this :SELECT [DebCode],[Debtor],ItemCode, ItemDescription,[Year],[1],[2],[3],[4],[5],[6],[7],
,[9],[10],[11],[12]FROM (SELECT DebCode,Debtor,ItemCode,ItemDescription,Year,Month,Sold FROM View_VK_ORDERS_SUMARY_F) AS PivotDataPIVOT (SUM(Sold) FOR Month IN ([1],[2],[3],[4],[5],[6],[7],
,[9],[10],[11],[12])) AS PIVOTINGorder by year,debtor
Thanks in advace for your help