You need to sign in to do that
Don't have an account?
Nathan Prats
Sum multiple SOQL Queries Results
Hi,
I'd like to sum the results of 2 queries. I'd use those results in order to double check some figures.
I pasted the two queries herebelow, they have different timeframe.
SELECT Sum(Power_of_1__c)
FROM Task
WHERE CallType = 'Outbound'
AND Sucessful_call__c = TRUE
AND CreatedDate >= LAST_N_WEEKS: 4
SELECT Sum(Power_of_1__c)
FROM Task
WHERE CallType = 'Outbound'
AND Sucessful_call__c = TRUE
AND CreatedDate >= LAST_N_MONTHS: 4
Any help would be much appreciated.
Nathan
I'd like to sum the results of 2 queries. I'd use those results in order to double check some figures.
I pasted the two queries herebelow, they have different timeframe.
SELECT Sum(Power_of_1__c)
FROM Task
WHERE CallType = 'Outbound'
AND Sucessful_call__c = TRUE
AND CreatedDate >= LAST_N_WEEKS: 4
SELECT Sum(Power_of_1__c)
FROM Task
WHERE CallType = 'Outbound'
AND Sucessful_call__c = TRUE
AND CreatedDate >= LAST_N_MONTHS: 4
Any help would be much appreciated.
Nathan
Unfortunately, I get this error : "MALFORMED_QUERY: unexpected token: List"
I use Force.com explorer and the Query i'm trying to build is not part of an apex code.
I'd use this Query in Conga Composer to fill an Excel Spreadsheet.
What I'm trying to do might not be possible I'm afraid.
Nathan.
Please use below mentioned code:
I don't think that we can do an AggregateResult SOQL in force.com explorer. I'm looking for a work around.