Problem: I want to fetch/process all the lead records that were created in Last 24 hours
Solution:
Use SOQL query like this
datetime objDateTime = System.now()-1;
List<Lead> lstLeads = new List<Lead>();
lstLeads = [select id,name from Lead where createddate >=:objDateTime];
System.debug('Leads:'+lstLeads);
Solution:
Use SOQL query like this
datetime objDateTime = System.now()-1;
List<Lead> lstLeads = new List<Lead>();
lstLeads = [select id,name from Lead where createddate >=:objDateTime];
System.debug('Leads:'+lstLeads);
Output:
No comments:
Post a Comment