![]() |
PowerPoint Report Template - Monthly Sales 2See Microsoft ® PowerPoint ® Report
Function and SQL
/* Calculate the sales amount and the quantity of products */
@F2_1=REPORT(slide=2 type=fix cell=B1,B7)
SELECT Sum(d.UnitPrice * d.Quantity * (1-d.Discount))
, SUM(d.Quantity)
FROM Orders o
,OrderDetails d
WHERE o.OrderID = d.OrderID
AND YEAR(o.OrderDate) = YEAR('$ReportMonth-01')
AND MONTH(o.OrderDate) = MONTH('$ReportMonth-01')
/* Calculate the number of customers and the number of orders */
@F2_2=REPORT(slide=2 type=fix cell=B3,B5)
SELECT COUNT(CustomerID)
, COUNT(OrderID)
FROM Orders
WHERE YEAR(OrderDate) = YEAR('$ReportMonth-01')
AND MONTH(OrderDate) = MONTH('$ReportMonth-01')
/* Calculate the sales amount */
@F2_3=REPORT(slide=2 type=fix cell=D2,E2)
SELECT Year(o.OrderDate)*100 + MONTH(o.OrderDate)
, Sum(d.UnitPrice * d.Quantity * (1-d.Discount))
FROM Orders o
,OrderDetails d
WHERE o.OrderID = d.OrderID
AND o.OrderDate >= DateAdd('m',-5,'$ReportMonth-01')
AND o.OrderDate < DateAdd('m',1,'$ReportMonth-01')
GROUP BY Year(o.OrderDate)*100 + MONTH(o.OrderDate)
ORDER BY 1 DESC
/* For chart */
@F2_4=CHART(slide=2 cell=A0)
SELECT Year(o.OrderDate)*100 + MONTH(o.OrderDate)
, Sum(d.UnitPrice * d.Quantity * (1-d.Discount))
FROM Orders o
,OrderDetails d
WHERE o.OrderID = d.OrderID
AND o.OrderDate >= DateAdd('m',-5,'$ReportMonth-01')
AND o.OrderDate < DateAdd('m',1,'$ReportMonth-01')
GROUP BY Year(o.OrderDate)*100 + MONTH(o.OrderDate)
ORDER BY 1 DESC
These sample reports are generated by PTReportGen (Report Generator for Microsoft PowerPoint). The sample reports in Microsoft PowerPoint format can be download for your report templates, and changed to adapt to your own needs. It is free. Download the report samples in Microsoft PowerPoint format PPT (560KB)
|
Copyright © 2006 LJZsoft Corporation. All rights reserved.