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
Abhi sfdcAbhi sfdc 

How to count the number of opportunity for a particular date?

 I want to count the number of opportunities for a particular date.
NikunjVadiNikunjVadi
should be something like this :
SELECT count() FROM Opportunity WHERE CreatedDate > 2015-06-30T00:00:00Z
badibadi
Try this,

List<AggregateResult> agg=[SELECT COUNT(Name) c FROM Opportunity WHERE CreatedDate > 2015-01-01T00:00:00Z];
Integer tCount=(Integer)agg[0].get('c');
System.debug(tCount);
Abhi sfdcAbhi sfdc
Thanks Nikunj and Bhawna for your prompt response.