﻿UPDATE dbo.ManHours_Plan SET AccountDisabled=0
WHERE EProjectId IN 
(SELECT EProjectId FROM dbo.Editor_EProject 
WHERE ((ProjectControl_JobStatus='Cancelled' AND ProjectControl_PC_CancelDate IS NOT NULL AND  DATEDIFF(DAY,ProjectControl_PC_CancelDate,GETDATE())<=31) 
       OR (ProjectControl_JobStatus='Hold' AND Job_Hold IS NOT NULL and DATEDIFF(DAY,Job_Hold,GETDATE())<=31)))

GO



	   