I am struggling with a way to combine two queries into one (obvious i am not an sql guru ;))
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)
The problem is if i am just adding them as
SELECT COUNT(orderid) AS ...,COUNT(errorid) AS ...
From tableorder inner join tableError
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.
So how could i get both counts in one query?