You need to sign in to do that
Don't have an account?
Smileonl
COUNT_DISTINCT not working
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,
I am not sure if this can help but are you using the latest Force.com PHP Toolkit:
http://wiki.developerforce.com/index.php/Force.com_Toolkit_for_PHP ?
COUNT_DISTINCT is only available for API version 18.0 and later.
Just a wild guess why this might not work for you.
Hi, i use the last version to PHP toolkit 20.
I do have same problem with SUM() aggregate function. The result type is AggregateResult but don't know how to handle this in Php. Any help appreciated.
Regards
Lakshman
Hi,
You may want to take a look at the thread I started in December about the support (or lack of it) in php toolkit 20.
See http://boards.developerforce.com/t5/Perl-PHP-Python-Ruby-Development/Problem-getting-counts-with-GROUP-BY-using-php-and-partner-wsdl/m-p/224829
I also saw another thread about a possible toolkit version 21. It's anybody's guess as to whether it will support count()/group by.
Colin G