Hello, Bernardina.
Following query gives you the result for accounts:
Select
account.name
,DATEDIFF(day, Max(activity.actualend), GetDate())
From FilteredAccount account
Left Join FilteredActivityParty actparty on account.accountid = actparty.partyid
Left Join FilteredActivityPointer activity on actparty.activityid = activity.activityid
Group By account.name, account.accountid
You can change it for any record you want.
Microsoft CRM Freelancer
My blog (english)
Мой блог (русскоязычный)
