I'm looking to create an SQL query that will return the Case Manager, total number of activity & count of description that begins with 'Outgoing Calls'.
At the moment, I run this and get an error message saying Method 'Open' of object'_Recordset' failed. I'm sure it's because of 'Outgoing Calls' because it works fine when I remove it.
Can anyone see why this is failing, or know any alternative way of counting the number of descriptions that begin with Outgoing Calls? Bear in mind that Case method does not work on VBA.
SELECT m.CaseManager,
SUM(m.Lead) AS 'Total Leads',
COUNT(a.Description) AS 'Total Activity',
COUNT(IF a.Description LIKE 'Outgoing Calls%' THEN 1 ENDIF) AS 'Outbound Calls'
FROM AccountTable m INNER JOIN ActivityTable a
ON m.AccountNumber=a.AccountNumber
GROUP BY m.CaseManager;