I'm looking to join the field Count from the query qCallCount to the results of the query qCustomers. I think I want to use a left join because there are customers in the qCustomers dataset that won't have a match in the qCallCount dataset, but I don't want to drop them from the results.
My current query...
SELECT a.CustomerID, b.Count, a.Customer_Segmentation
FROM qCustomers AS a LEFT JOIN qCallCount AS b ON a.CustomerID=b.CustomerID;
My question is, is there a way to make the value for the Count field in the result of this query have a value of 0 if there's no match in qCallCount? If this was Excel I'd write an =IFERROR(VLOOKUP(CustomerID, qCallCount, Count, False),0)
Why do I need this? I'm ultimately going to run an average of count avg(Count) as Average
and it's important for those failed matches to be treated as zero, because that's what they actually are.
Thanks!