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
BritishBoyinDCBritishBoyinDC 

Using MAX() with over 10,000 rows

Maybe I am missing something wth the new aggregrate functions, but should I be able to execute a simple query like this when the object has > 10,000 rows of data, or should I still be using the old 'order by closedate desc limit 1' syntax? Currently, I get an error saying the query rows returned is too large...

 

 

AggregateResult[] groupedResults = [Select max(closedate) maxcdate from Opportunity WHERE closedate != null]; system.debug('CheckDate' + groupedResults[0].get('maxcdate'));