Hi All -- my first post. I've searched many threads trying to find a similar problem but no one is trying to do this update they way I need it.. I think a trigger might be the solution? let me know what you think
IF W.DESIRED_WANT_DATE < GETDATE()
SET WO.DESIRED_WANT_DATE = DATEADD(day, @amount, W.DESIRED_WANT_DATE)
SET WO.DESIRED_WANT_DATE = DATEADD(day, @amount, RWD.REQUIRED_DATE)
JOIN (SELECT *, CASE CHARINDEX(',', USER_1) WHEN 0 THEN USER_1 ELSE LEFT(USER_1, (CHARINDEX(',', USER_1)-1)) END ISSUE_TO FROM WO_WANT_DATE) WO ON (WO.ROWID = W.ROWID)
JOIN REQUIREMENT_WANT_DATE RWD ON (RWD.BASE_ID = WO.ISSUE_TO AND RWD.PART_ID = WO.PART_ID)
JOIN PART P ON (P.ID = W.PART_ID)
Basically I need help with the IFs that follow the UPDATE, is that possible to enclose the SET statements in there?