• SFDCIntegration
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
I am trying to search for leads in a particular month and I see discrepancies between the rows returned when I run the report in Salesforce.com Vs what I get from SOQL.
 
The query I am using is

Select l.Company, l.ConvertedDate, l.Description, l.Id, l.OwnerId, l.IS_Rep__c,l.owner.firstname,l.owner.lastname from Lead l where l.convertedDate != null and l.convertedDate >= 2008-01-01 and l.convertedDate <= 2008-01-31 and l.IS_Rep__c <> '' and l.IS_Rep__c = 'SOME NAME'

I see 20 rows returned by the above query while I see 22 rows returned by the report.

The interesting thing I noticed is the two missing rows were updated on the last day of the month, 2008-01-31.

If I modify the query to below then I see those two rows

Select l.Company, l.ConvertedDate, l.Description, l.Id, l.OwnerId, l.IS_Rep__c,l.owner.firstname,l.owner.lastname from Lead l where l.convertedDate != null and l.convertedDate >= 2008-01-01 and l.IS_Rep__c <> '' and l.IS_Rep__c = 'SOME NAME'

Also If I do the below query I see the rows.

Select l.Company, l.ConvertedDate, l.Description, l.Id, l.OwnerId, l.IS_Rep__c,l.owner.firstname,l.owner.lastname from Lead l where l.convertedDate != null and l.convertedDate >= 2008-01-01 and l.convertedDate <= 2008-02-01 and l.IS_Rep__c <> '' and l.IS_Rep__c = 'SOME NAME'

Has any one seen this issue? Is there a problem with "<=" operator or does Salesforce store data in different format than what is displayed in the UI like GMT internally?

 

Thanks,

-Anil

 

 

 

 

I am trying to search for leads in a particular month and I see discrepancies between the rows returned when I run the report in Salesforce.com Vs what I get from SOQL.
 
The query I am using is

Select l.Company, l.ConvertedDate, l.Description, l.Id, l.OwnerId, l.IS_Rep__c,l.owner.firstname,l.owner.lastname from Lead l where l.convertedDate != null and l.convertedDate >= 2008-01-01 and l.convertedDate <= 2008-01-31 and l.IS_Rep__c <> '' and l.IS_Rep__c = 'SOME NAME'

I see 20 rows returned by the above query while I see 22 rows returned by the report.

The interesting thing I noticed is the two missing rows were updated on the last day of the month, 2008-01-31.

If I modify the query to below then I see those two rows

Select l.Company, l.ConvertedDate, l.Description, l.Id, l.OwnerId, l.IS_Rep__c,l.owner.firstname,l.owner.lastname from Lead l where l.convertedDate != null and l.convertedDate >= 2008-01-01 and l.IS_Rep__c <> '' and l.IS_Rep__c = 'SOME NAME'

Also If I do the below query I see the rows.

Select l.Company, l.ConvertedDate, l.Description, l.Id, l.OwnerId, l.IS_Rep__c,l.owner.firstname,l.owner.lastname from Lead l where l.convertedDate != null and l.convertedDate >= 2008-01-01 and l.convertedDate <= 2008-02-01 and l.IS_Rep__c <> '' and l.IS_Rep__c = 'SOME NAME'

Has any one seen this issue? Is there a problem with "<=" operator or does Salesforce store data in different format than what is displayed in the UI like GMT internally?

 

Thanks,

-Anil