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
KRISH9KRISH9 

SOQL query to retrive the records "created date is more than 90 days"

How to write SOQL query to get the records CreatedDate > 90days

 

 

Rahul SharmaRahul Sharma

KRISH9,

 

There are some  already defined, Try using them as a filter criteria in your query.

 

For your case it would be like Below:

 

SELECT Id FROM Account WHERE CreatedDate > LAST_90_DAYS

 Refer this link for more date literals.

Sanjan Grero SFDCSanjan Grero SFDC
Created prior to "90 days before" (ie: older than 90 days) should be: 
SELECT Id FROM Account WHERE CreatedDate < LAST_90_DAYS