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
Sean NolansSean Nolans 

SOQL query for date range


 am looking to build a query that includes a date range.
I want to be able to say departure_date_c + 330 days from now

We have this in a formula field and it looks like this 
departures_dates__r.date__c < (TODAY() + 330)


But I want to be able to edit my sql query in your tool to include this .You builder does not allow for something like this but it looks like I can manually edit your SOQL query 


Any ideas how to turn the above formual field into a query

thanks 
 
Best Answer chosen by Sean Nolans
Raj VakatiRaj Vakati

TRY THIS .. USE LAST_N_DAYS:330 fuction 
https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_dateformats.htm?search_text=LAST_N


 

SELECT Id FROM Account WHERE CreatedDate = LAST_N_DAYS:330