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
SriniSrini 

How to get the query the data that has been modified in last 24 hours .

Hi All,

How to get the query the data that has been modified in last 24 hours  ?

Can any one helpme on this query

Thanks in advance
veda Hebbarveda Hebbar
Hi Srini,

Please try below query:
Select Id, Name From Account Where LastModifiedDate >= LAST_N_DAYS:1

Thanks,
Vedashri
 
Vasani ParthVasani Parth
+1 . You can also use SystemModStamp fields in your query :
Select Id from Account where SystemModStamp >= 2014-11-19T23:01:01Z
Here is a blog explaining about the SystemModStamp and LastModifiedDate:https://developer.salesforce.com/blogs/engineering/2014/11/force-com-soql-performance-tips-systemmodstamp-vs-lastmodifieddate-2.html?d=70130000000llMA

Please mark this as the best answer if this helps
 
SriniSrini
Hi Parth,

The ablove query has showing for all Account records.But i want to show who ever updated in last 24 hr.
We are mentioned like below:

Select Id from Account where LastModifiedDate >= 2014-11-19T23:01:01Z

thanks
Vasani ParthVasani Parth
Srini - Can you please try one more time . Because if you click on "All accounts" list view, then only it will show all accounts,otherwise fetching this query will surely give the updated one.

Please mark this as the best answer if this helps
veda Hebbarveda Hebbar
Hi Srini,

Have you tried below query?
 
Select Id, Name From Account Where LastModifiedDate >= LAST_N_DAYS:1

 
SriniSrini
Hi Veda,

Yes,I have tried when we are using the  single query it has getting the records like who ever modified the reeocrds from last 24hrs,but we have implemented the some code in that it is not working.

Thanks
 
veda Hebbarveda Hebbar
Hey Srini,

Can you share your code here? Need to check how it is used, so that I can try solution.
SriniSrini
Hi Veda,

Plese find the below code :
Select Parent_ID__c, Min(Fine_Date_Formula__c) Symbol_StatusDate from Account where Parent_ID__c!=Null and Fine_Date_Formula__c!=Null and LastModifiedDate >= LAST_N_DAYS:1

Please check and help me

Thanks
veda Hebbarveda Hebbar
Hi Srini,

Sorry for delay. I feel you don't have any record which matchs your WHERE condition. Please check once.

I have excecuted similar query in dev console. It is working fine for me.
 
Select Id, Name From Account Where Contact__c!=Null And SLASerialNumber__c!= null And LastModifiedDate >= LAST_N_DAYS:1

Please let me know if that is also not working for me.

Thanks,
Vedashri
 
SriniSrini
Hi Veda,

Ok, we will try and let you know 

Thanks for your reply.

Regards.