Let's create our third report and call it
SalesTerritoryReport. Use the template we created in the previous chapter.
Find the SQL script called
uspSalesPersonSalesByYear.sql and execute it to create a stored procedure called
dbo.uspSalesPersonSalesByYear. This stored procedure has one parameter, that is,
As you might have noticed, the query returns sales total for years 2005, 2006, 2007, and 2008 by territory, using the
PIVOT function in T-SQL.
Again, let's keep this simple:
The report designer added an
ID prefix to our year columns (for example, ID2005) because field names must start with a letter ...