You need to sign in to do that
Don't have an account?
kito kid
records with last updated date within 1hour
I am following the code below to grab the records which has been modified within last 1 hour.
Select a.Id From Account a
Where a.LastModifiedDate = TODAY AND HOUR_IN_DAY(a.LastModifiedDate) > 24
But , I can't get any records.
Any idea to get something like this.
Hi kito,
You have to write following SOQL query for display last updated record within 1hour.
Important :
Hit Kudos if this provides you with useful information and if this is what you where looking for then please mark it as a solution for other benefits.
Thank You,
Hitesh Patel
SFDC Certified Developer & Administrator
My Blog:- http://mrjavascript.blogspot.in/
All Answers
Hi kito,
You have to write following SOQL query for display last updated record within 1hour.
Important :
Hit Kudos if this provides you with useful information and if this is what you where looking for then please mark it as a solution for other benefits.
Thank You,
Hitesh Patel
SFDC Certified Developer & Administrator
My Blog:- http://mrjavascript.blogspot.in/
DateTime dt = System.Now().addHours(-1);
List<Account> accLst = [SELECT Id, Name FROM Account WHERE LastModifiedDate>=:dt];
System.debug(‘@@@List Of all Account records created within last 12 hours@@@’ + accLst);
Hitesh: I've a query- Why you are using LastModifieddate = Today? It may be there in different days but within 1 hour?
Thanks,
Kaity