I have the following crosstab which works well.
Code:
TRANSFORM Sum(qun_Sales_Total.InvItems) AS Inv_Total
SELECT qun_Sales_Total.SalespNo AS [Agency No], qun_SalesPerson.SalesPersonName AS Agency, Sum(qun_Sales_Total.InvItems) AS [Total This Agency]
FROM qun_Sales_Total INNER JOIN qun_SalesPerson ON qun_Sales_Total.SalespNo = qun_SalesPerson.SpNo
GROUP BY qun_Sales_Total.SalespNo, qun_SalesPerson.SalesPersonName
ORDER BY qun_Sales_Total.SalespNo
PIVOT Year(InvoiceDate);
However, I would like to add columns showing the sales delta in percent from year to year as a column. The final result should look something like this:
Sales 2008 2008-2007 Sales 2009 2009-2008
$5 100% 10 100%
I have found this example (at the bottom of the page) but can't get it to work. Any help will be appreciated.