You need to sign in to do that
Don't have an account?

Opportunities Aggregate Query Group By RecordType & ContactId
Any ideas on how to query for Opps created last month (for certain recordtypes only) and group by ContactId then by record type?
Query: SELECT COUNT(Id) idSum, SUM(Consolidated_Opportunities_Count__c) consolidatedSum FROM Opportunity WHERE CreatedDate = LAST_MONTH AND (RecordType.Name = 'A' OR RecordType.Name = 'B' OR RecordType.Name = 'C') GROUP BY ContactId, RecordTypeId
Thanks fo your help!
Bronco
Query: SELECT COUNT(Id) idSum, SUM(Consolidated_Opportunities_Count__c) consolidatedSum FROM Opportunity WHERE CreatedDate = LAST_MONTH AND (RecordType.Name = 'A' OR RecordType.Name = 'B' OR RecordType.Name = 'C') GROUP BY ContactId, RecordTypeId
Thanks fo your help!
Bronco