I am to prepare a query in SOQL which will return me only contacts that have more than 7 activities in last 12 months.
I am able to fetch the contacts but not sure how I can use "ActivityHistory" table in the query.
Goal is to Prepare Query for
"Get contacts for which we have more than 7 activities in last 12 Month"
To Elaborate more:
Select c.Name, c.Id, (Select Id, IsTask, ActivityDate, ActivityType,
CallType From ActivityHistories) From Contact c where LastActivityDate =
LAST_N_MONTHS:12
Here I can get Contacts with any activity in last 12 months.
I am working to find how we can filter only contacts with more than "x" activities.