Chapter 5 Exercise 7

7. Which employee had the highest percent of the number of sales (not value) in January?

SELECT Employee.EmployeeID, Employee.LastName, Count(Sale.SaleID) AS CountOfSaleID,
Count(Sale.SaleID) /
(SELECT Count(SaleID) FROM Sale
WHERE SaleDate Between #1/1/2013# and #1/31/2013#) As Pct
FROM Employee INNER JOIN Sale ON Employee.EmployeeID = Sale.EmployeeID
WHERE (((Sale.SaleDate) Between #1/1/2013# And #1/31/2013#))
GROUP BY Employee.EmployeeID, Employee.LastName
ORDER BY Count(Sale.SaleID) DESC;