title: SQL Query for counting number of orders per customer and Total Dollar amount
body: <p>I have two tables
  <code>Order</code> with columns:</p>
  
  <pre><code>OrderID,OrderDate,CID,EmployeeID
  </code></pre>
  
  <p>And <code>OrderItem</code> with columns:</p>
  
  <pre><code>OrderID,ItemID,Quantity,SalePrice
  </code></pre>
  
  <p>I need to return the CustomerID(CID), number of orders per customer, and each customers total amount for all orders.</p>
  
  <p>So far I have two separate queries. One gives me the count of customer orders....</p>
  
  <pre><code>SELECT CID, Count(Order.OrderID) AS TotalOrders
  FROM [Order]
  Where CID = CID 
  GROUP BY CID
  Order BY Count(Order.OrderID) DESC;
  </code></pre>
  
  <p>And the other gives me the total sales. I'm having trouble combining them...</p>
  
  <pre><code>SELECT CID, Sum(OrderItem.Quantity*OrderItem.SalePrice) AS TotalDollarAmount
  FROM OrderItem, [Order]
  WHERE OrderItem.OrderID = [Order].OrderID
  GROUP BY CID
  </code></pre>
  
  <p>I'm doing this in Access 2010.</p>