+ Start a Discussion
Rajesh SFDCRajesh 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
BalajiRanganathanBalajiRanganathan
ActivityHistories is to track completed tasks and event.
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.