I have a list of accounts that I need to get the last meeting that has been held with each account. Unfortunately the following SOQL doesn't work. I get the following error: "field ActivityDate does not support operator MAX
SELECT WhatId, MAX(ActivityDate) FROM Task WHERE Type = 'Meeting' AND WhatId in :accountIds GROUP BY WhatId
I don't really want to select all activities and loop through them to find the max for each account. Any other solutions?