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
Sarma DuvvuriSarma Duvvuri 

batch class to fetch the records based on time

Hi All,

Please provide any sample code of Batch class to fetch the records based on time and date.

Thanks,
Sarma
NagendraNagendra (Salesforce Developers) 
Hi Sarma,

May I suggest you please refer to below link from the stack exchange community with a similar discussion which might help you further. Hope this helps.

Kindly mark this as solved if the reply was helpful.

Thanks,
Nagendra
Sarma DuvvuriSarma Duvvuri
Thank you for the quick response. but my scenario is diffferent.

I have to run the batch based on the schedule time when the queue is having maximum of 7 records (Fields- Queue Name, Public Group, Start Time, End Time, Day) .
For example
Queue, Public Group, 9:00 am , 9:00 pm, Monday
If the data is like this, then the batch job should move public group everyday
Queue, Public Group, 9:00 am , 9:00 pm, All
 If there is no record for a day then the batch process does not need to do anything.