function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sissyphussissyphus 

Date inconsistencies

Trying to populate some charts using the PHP API but I'm getting back inconsistent numbers when I try to slice up a time period from a quarter to the individual months.
 
 
Running one query which is supposed to get back the number of deals that happened during the first quarter of this year:

               SELECT Loss_Date__c, Sales_Region__c, StageName, Amount FROM Opportunity WHERE StageName ='LOST' AND IsWon =FALSE AND Loss_Date__c > 2008-01-01 AND Loss_Date__c < 2008-01-31 ORDER BY Loss_Date__c

This query returns 381 records

When I run a similar query for the first three individual months of 08 using their respective boundary dates I get back 195, 97, and 66 records respectively which add up to 358 and makes no sense.

'Jan-08' => array('2008-01-01', '2008-01-31'),
'Feb-08' => array('2008-02-01', '2008-02-28'),
'Mar-08' => array('2008-03-01', '2008-03-31'),

Can you tell me why sales force is returning such different results?