You need to sign in to do that
Don't have an account?
Mubarak
How to get the number of records in a particular date range.
Hi all
How to get the number of records in a particular date range.
For example i am having object called orderline.i want to get number of records were created during 12-jan-2014 to 12-dec-2014.
Currently am using force.com explorer so i need a query to get the expected result.
Thanks
How to get the number of records in a particular date range.
For example i am having object called orderline.i want to get number of records were created during 12-jan-2014 to 12-dec-2014.
Currently am using force.com explorer so i need a query to get the expected result.
Thanks
SELECT Name,createddate From orderline__c where createddate > 2015-03-04T01:02:03Z and createddate < 2015-03-31T01:02:03Z
SELECT count() From orderline__c where createddate > 2015-03-04T01:02:03Z and createddate < 2015-03-31T01:02:03Z
All Answers
date d2 = system.date.parse('03/31/2015');
list<orderline__c> a = [SELECT Name,createddate From orderline__c WHERE createddate > :d1 and createddate < :d2];
integer b = [SELECT count() From orderline__c WHERE createddate > :d1 and createddate < :d2];
system.debug(a);
system.debug(b);
SELECT Name,createddate From orderline__c where createddate > 2015-03-04T01:02:03Z and createddate < 2015-03-31T01:02:03Z
SELECT count() From orderline__c where createddate > 2015-03-04T01:02:03Z and createddate < 2015-03-31T01:02:03Z