• Smileonl
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies

 

Hi, I have an error when trying to use SUM() in a query. 
Request:
SELECT SUM(Amount) FROM Opportunity
 
Error:
Warning (2) - Invalid argument supplied for foreach() in /var/www/dev.local/system/libraries/salesforce/SforcePartnerClient.php on line 344

 

Hi all, I have a question why such a query works

SELECT COUNT() FROM OpportunityHistory WHERE  OpportunityId IN (SELECT Id FROM Opportunity WHERE CreatedDate = THIS_WEEK)

 and such an error

SELECT COUNT_DISTINCT(OpportunityId) FROM OpportunityHistory WHERE  OpportunityId IN (SELECT Id FROM Opportunity WHERE CreatedDate = THIS_WEEK)

 

ERROR:

 

 Invalid argument supplied for foreach() in /var/www/dev.local/system/libraries/salesforce/SforcePartnerClient.php on line 344

Hi all, I have a question why such a query works

SELECT COUNT() FROM OpportunityHistory WHERE  OpportunityId IN (SELECT Id FROM Opportunity WHERE CreatedDate = THIS_WEEK)

 and such an error

SELECT COUNT_DISTINCT(OpportunityId) FROM OpportunityHistory WHERE  OpportunityId IN (SELECT Id FROM Opportunity WHERE CreatedDate = THIS_WEEK)

 

ERROR:

 

 Invalid argument supplied for foreach() in /var/www/dev.local/system/libraries/salesforce/SforcePartnerClient.php on line 344