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 

Quarter and months don't match up.

I ran the same query with three different times specified and got three different results. I ran the query once using "LAST_QUARTER", once using the dates describing that quarter, then three times using the dates which describe those months. Different answers!

 

Q1 08

"SELECT Severity__c, S__c, Owner.Name, IsClosed, CreatedDate FROM Case WHERE CreatedDate > 2008-01-01T00:00:01Z AND CreatedDate < 2008-03-31T23:59:59Z"

RESULT: 2012

 

 

MONTHS IN Q1 QUERIED INDIVIDUALLY

January

"SELECT Severity__c, S__c, Owner.Name, IsClosed, CreatedDate FROM Case WHERE CreatedDate > 2008-01-01T00:00:01Z AND CreatedDate < 2008-01-31T23:59:59Z"

RESULT: 663

 

February

"SELECT Severity__c, S__c, Owner.Name, IsClosed, CreatedDate FROM Case WHERE CreatedDate > 2008-02-01T00:00:01Z AND CreatedDate < 2008-02-28T23:59:59Z"

RESULT: 632

 

March

"SELECT Severity__c, S__c, Owner.Name, IsClosed, CreatedDate FROM Case WHERE CreatedDate > 2008-03-01T00:00:01Z AND CreatedDate < 2008-03-31T23:59:59Z"

RESULT: 692

 

TOTAL RESULT: 1987

 

A difference of 25!

 

How is this possible? What am I doing wrong? I need some help on this.

 

Lori_Lori_

You're not including the beginning and ending dates in your logic.

Change your signs

> to >=

< to <=