+ Start a Discussion
cmarzillicmarzilli 

Query Max or Query Last?

I am trying to get the last completed task on an account.  Is there a way I can query MAX(Task_date) or is there a query I can use that will get the last completed task on an account?
 
Thanks!
SuperfellSuperfell
select id, name, (select id, subject from activityHistories order by ActivityDate desc limit 1) from account where id='someAccountId'
cmarzillicmarzilli
SimonF - you rock!