I have a SQL database that stores department sales for my items. I want a query that can show me the previous year sales for a department at the same time.
Here is what I have so far, can anyone please help me?
SELECT Department.Name, SUM([Transaction].Total) AS [Total Department Sales]
FROM [Transaction] INNER JOIN
TransactionEntry ON [Transaction].TransactionNumber = TransactionEntry.TransactionNumber INNER JOIN
Item ON TransactionEntry.ItemID = Item.ID INNER JOIN
Department ON Item.DepartmentID = Department.ID
WHERE ([Transaction].Time BETWEEN '10/01/2007' AND '10/30/2007')
Group by Department.Name