Thanks BandiI get the follow errorMsg 195, Level 15, State 10, Procedure Update_Punch, Line 5'updated' is not a recognized built-in function name.Msg 195, Level 15, State 10, Procedure Update_Punch, Line 16'UPDATED' is not a recognized built-in function name.
Here is my codeALTER TRIGGER [dbo].[Update_Punch] ON [dbo].[TIMESHEETITEM]FOR UPDATEAS if(updated(Enddtm))BEGIN SET NOCOUNT ON; insert A_TABLE(PunchTime,EmployeeID, EntryType,Name,TimeSheetId, PunchEventId, PersonNum) select EndDTM,EmployeeId, 'P20',p.FullNM,TIMESHEETITEMID,ENDPUNCHEVENTID, p.PersonNum from inserted i left join Person p on p.PersonID = i.EmployeeID WHERE ENDPUNCHEVENTID NOT IN (SELECT PunchEventId FROM dbo.a_table)ENDIF( UPDATED(STARTDTM) )begin SET NOCOUNT ON; insert A_TABLE(PunchTime,EmployeeID, EntryType,Name,TimeSheetId, PunchEventId,PersonNum) select StartDTM,EmployeeId, 'P10',p.FullNM,TIMESHEETITEMID,STARTPUNCHEVENTID,p.PersonNum from inserted i left join Person p on p.PersonID = i.EmployeeID WHERE ENDPUNCHEVENTID NOT IN (SELECT PunchEventId FROM dbo.a_table)end
My Free .NET Controls at www.qiosdevsuite.com Includes 30 Controls, Ribbon Toolbar, Ribbon Form etc...