SOQL to get next 7 days records

SOQL to get next 7 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 7 days.


Sample SOQL:

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




Cheers!!!

Leave a Reply