Hi
I have a pivot like this
Select
CalendarYear,CalendarMonth,
count([ID]) asNumberOfOrders
FROM[Database].[dbo].[DataTable]
PIVOT
(
SUM(NumberOfOrders)FORCalendarMonthIN([1],[2],[3],[4],[5],[6],[7],[8],[9],[10],[11],[12])
)ASpv1
I wish to order by the CalendarYear, CalendarMonth, but cannot do this because I cannot place an order by before the pivot. How can I do this please
please help