The following will mark all tasks that are related to a closed/archived matter as Complete.
- --The client has a bunch of tasks related to archived matters.
- --These tasks are NOT follow-ups and they NEVER intend on completing them.
- --The client would like us to close them out.
- UPDATE
- __M_Tasks
- SET
- Final_Stage = 'Complete'
- FROM
- __M_Tasks V1,
- __M_Tasks_Related_Entities V2,
- __M_Matters V3
- WHERE 1=1
- AND V1.Id = V2.Final_TaskEntry_Id
- AND V2.Final_RelatedTo_Id = V3.Id
- AND V2.Final_RelatedTo_Type = '__M_Matters'
- AND V3.Final_Status = 'Archived'