**Delete Tasks and Cases in Xpert.ivy 3.9**
<br/><br/>
**via Workflow Admin UI**
Workflow Administrators can delete tasks and cases within a date range over the administration UI.
![alt text][2]
<br/><br/>
**via SystemDB**
Sample query to select taskIds which will be destroyed. Rewrite it to a DELETE statement to really remove the data.
SELECT d.TaskId
FROM IWA_TaskData as d
JOIN IWA_Task as t ON d.TaskId = t.TaskId
WHERE t.State IN (6,7) /** delete only done and destroyed tasks **/
AND d.TaskDataKind = 1; /** delete only start data, keep current data **/
AND t.DoneTimestamp = XYZ /** limit the date: only delete data older than 3 years or similar **/
[1]: http://developer.axonivy.com/doc/latest/publicApi/ch/ivyteam/ivy/workflow/IWorkflowContext.html#deleteCompletedCase-ch.ivyteam.ivy.workflow.ICase-
[2]: http://answers.axonivy.com/upfiles/clear39tasksAndCases.png