My Requirement is "the records should be considered next only when they complete 12 months" and this is monthly exercise so if i query the data from database it should not include the previous data.

suppose I have sent_Date__C custom field(which stores date of record used or query date), when ever i query data i need to use sent_Date__C field and get data from database.

the previous data should be included when the difference of sent_Date__C field and tdys date should be 1 year.

I want the data using SOQL.


1 Answer 1


You need to be more precise about the timeframe you're looking at (are you looking for records that are exactly 1 year old? ones that are up to 1 year and 1 week old? etc...)

The SOQL and SOSL Date Formats and Date Literals page is a good place to start looking. Even though it's not documented, the N_WEEKS_AGO:<integer> literal may be useful here.

This site is temporarily in read-only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .