M Azid Wahyudi, 11/21/2023 03:54 PM
CREATE TRIGGER AfterInsertPHRPA0019CrossDay
ON PHRPA0019
AFTER INSERT
AS
BEGIN
SET NOCOUNT ON;
UPDATE p
SET EndDate = i.StartDate
FROM PHRPA0019 p
INNER JOIN inserted i ON p.EmployeeID = i.EmployeeID
WHERE i.StartDate != p.EndDate
END;