title: Nested sql count from two count queries into one query
body: <p>I am struggling with a way to combine two queries into one (obvious i am not an sql guru ;))</p>
  
  <pre><code>SELECT COUNT(orderid) AS TotalAmountOfOrders
  FROM tableorder
  WHERE (YEAR(orderDate) BETWEEN 2012 AND 2012)
  
  
  SELECT COUNT(errorid) AS AmountOfErrorsOnOrders
  FROM  tableError                      
  WHERE (YEAR(errorDate) BETWEEN 2012 AND 2012)
  </code></pre>
  
  <p>The problem is if i am just adding them as</p>
  
  <pre><code>SELECT COUNT(orderid) AS ...,COUNT(errorid) AS ...
  From tableorder inner join tableError
  </code></pre>
  
  <p>I am not getting the total amount but only the amount of orders with errors cause of the way of how i am bringing them together. </p>
  
  <p>So how could i get both counts in one query?</p>