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
Ishan Singh 4Ishan Singh 4 

I want to make a query in my batch class for leads whose birthday is exact 7 days from today so what formula I should use?

Currently  I am using NEXT_N_DAYS : 7 but it is running for leads with 7 days and also for less than 7 days
Sachin HoodaSachin Hooda
Hi Ishan,
To get the specific records you can do like,
Date dt = System.today().addDays(7);
CustomObject__c obj = [SELECT Id From CustomObject__C where birthdate__c =: dt];
System.debug(obj);
In case you still have any problem, please post them here.
_____
Regards, 
Sachin
(: