How to query the data that has been modified in last 24 hours
You can use the existing LastModifiedDate or SystemModStamp fields in your SOQL query (See System Fields). The
TODAYdate literals may be useful. Otherwise you can use a specific calculated UTC Date time value.
Select Id from Account where SystemModStamp >= LAST_N_DAYS:1 Select Id from Account where SystemModStamp >= 2014-11-19T23:01:01Z
There was a recent blog post on the performance implications of LastModifiedDate vs SystemModStamp - Force.com SOQL Performance Tips: LastModifiedDate vs SystemModStamp
Thanks it's working fine.. what's the difference between systemModStamp and lastmodifiedDate.
@AnkitKhandelwal The differences are covered in the linked System Fields and Performance Tips pages. `SystemModstamp` gets updated for **all** changes and is strictly read-only. `LastModifiedDate` is only for user changes and can be updated.
Below query won't give last 24 hours data , if I don't run it @ 12 in Midnight.. I have a java program that schedule @ 8 pm ever ngiht and I have get the data for last 24 hours. /services/data/v32.0/query/?q=select ID from Custom_Object_HDS__c where LastModifiedDate = Today