SOQL to get next 45 days records

Next_N_Days is used to get next N days records from the object.

The below query will fetch accounts where it\’s Next Billing Date is today and within next 45 days.

Sample SOQL:

SELECT Id FROM Account WHERE Next_Billing_Date__c >= TODAY AND Next_Billing_Date__c  <= Next_N_Days:45


Leave a Comment

Your email address will not be published. Required fields are marked *

Select Language »