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

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?
select id, name, (select id, subject from activityHistories order by ActivityDate desc limit 1) from account where id='someAccountId'
SimonF - you rock!