Hey all! I have a report that breaks down the total number of items sold during the month. It is broken down by week.
The user inputs the start and end date, and it pulls all items sold each week, and the cost. Now what they want is this.
From week 1, say we have "Item1" that sold 200 units.
Week 2, "Item1" sold 350 units. The client wants the percentage of change from those two figures.
My problem is, how do I do this since the report really only has the one field labeled "Items" and one labeled "Total Sold". The query pulls all the data and sorts it accordingly. In case I'm not making myself clear, the report looks something like this...
Week of ITEM Description Total Sold % Change
10/12/03 ATP3 3 piece lifestyle 209
10/19/03 ATP3 3 piece lifestyle 300 NEED THIS
How would I do this? The SQL code for the query looks like this as of now and all works great except for getting the % Change to work...
-------code starts---------
SELECT DISTINCT tblCompany.WeekBeginning, tblCompany.WeekEnding, tblInventoryTable.SKU, tblInventoryTable.Description, Sum(tblInventoryTable.UnitsSold) AS SumOfUnitsSold
FROM tblCompany INNER JOIN tblInventoryTable ON tblCompany.Company = tblInventoryTable.Company
GROUP BY tblCompany.WeekBeginning, tblCompany.WeekEnding, tblInventoryTable.SKU, tblInventoryTable.Description
HAVING (((tblCompany.WeekBeginning) Between [Enter Starting Date] And [Enter Ending Date]));
Thanks all!
Thanks everyone!
The user inputs the start and end date, and it pulls all items sold each week, and the cost. Now what they want is this.
From week 1, say we have "Item1" that sold 200 units.
Week 2, "Item1" sold 350 units. The client wants the percentage of change from those two figures.
My problem is, how do I do this since the report really only has the one field labeled "Items" and one labeled "Total Sold". The query pulls all the data and sorts it accordingly. In case I'm not making myself clear, the report looks something like this...
Week of ITEM Description Total Sold % Change
10/12/03 ATP3 3 piece lifestyle 209
10/19/03 ATP3 3 piece lifestyle 300 NEED THIS
How would I do this? The SQL code for the query looks like this as of now and all works great except for getting the % Change to work...
-------code starts---------
SELECT DISTINCT tblCompany.WeekBeginning, tblCompany.WeekEnding, tblInventoryTable.SKU, tblInventoryTable.Description, Sum(tblInventoryTable.UnitsSold) AS SumOfUnitsSold
FROM tblCompany INNER JOIN tblInventoryTable ON tblCompany.Company = tblInventoryTable.Company
GROUP BY tblCompany.WeekBeginning, tblCompany.WeekEnding, tblInventoryTable.SKU, tblInventoryTable.Description
HAVING (((tblCompany.WeekBeginning) Between [Enter Starting Date] And [Enter Ending Date]));
Thanks all!
Thanks everyone!