You need to sign in to do that
Don't have an account?
Rajesh SFDC
how to query five recent last modified dates for single records in apex
here, i am written query like this, its shows nulls
Select Id, Name, (Select Subject, LastModifiedDate from ActivityHistories Order By LastModifiedDate DESC ) From Account
Select Id, Name, (Select Subject, LastModifiedDate from ActivityHistories Order By LastModifiedDate DESC ) From Account
if you have enabled tracking to acccount field then you can try this SOQL
SELECT Id, Name, (SELECT CreatedDate FROM Histories Order by CreatedDate DESC) FROM Account
to get the last five records for each accound you might have to group by create date.