title: SQL Server 2014: Products sold count by each employee
body: <p>I have an Employee table and a Product table. A 3rd table (ProductsSold) contains an EmployeeID, ProductID, DateSold.</p>
  
  <p>The ProductsSold table contains a product sold by an employee on a specific date.</p>
  
  <p>I am trying to get the count of each product sold by each employee (even if the employee sold 0 products they need to show up)</p>
  
  <p><img src="https://i.imgur.com/Vc2dRZq.jpg" alt="sample"></p>
  
  <pre><code>select e.EmployeeName, p.ProductName, count(*) as c
  from ProductsSold ps 
      inner join product p on ps.productid = p.productid
      inner join employee e on ps.employeeid = e.employeeid
  group by e.EmployeeName, p.ProductName
  order by e.EmployeeName
  </code></pre>
  
  <p>Do I need to write a Pivot query? This is going to become an SSRS report. Does SSRS support Pivot queries?</p>