CREATE TRIGGER [YearEndProcessing_Mgr] ON [TimeSheet_MGR_TBL]
FOR UPDATE
AS
Hi All,
Still learning triggers. I have a table (timesheet_mgr_Tbl what holds all 7 rows for each employee. Each row has a date fields (mon - fri) for a given week.
I want the trigger to fire when the APPROVED flag ='Y' and if January 1st falls within those seven days.
I need to embed a select statement that will perhaps return a count if it finds a 01/01 date. Any help would be appreicated. Below is my meger trigger which doesn't quite work...
DECLARE @emplid varchar(6)
select @emplid = emplid from updated
DECLARE @DTE varchar(6)
select @DTE = "01/01"/ + year(date) from updated
If (select Approved from updated) = 'Y' and (select date from updated where ) like '01/01%'
and (select emplid from updated) = @emplid
exec YearEnd_Accrual_Vacation @DTE, @emplid
exec YearEnd_Carryover_Vacation @DTE, @emplid
exec YearEnd_Accrual_Personal @DTE, @emplid
FOR UPDATE
AS
Hi All,
Still learning triggers. I have a table (timesheet_mgr_Tbl what holds all 7 rows for each employee. Each row has a date fields (mon - fri) for a given week.
I want the trigger to fire when the APPROVED flag ='Y' and if January 1st falls within those seven days.
I need to embed a select statement that will perhaps return a count if it finds a 01/01 date. Any help would be appreicated. Below is my meger trigger which doesn't quite work...
DECLARE @emplid varchar(6)
select @emplid = emplid from updated
DECLARE @DTE varchar(6)
select @DTE = "01/01"/ + year(date) from updated
If (select Approved from updated) = 'Y' and (select date from updated where ) like '01/01%'
and (select emplid from updated) = @emplid
exec YearEnd_Accrual_Vacation @DTE, @emplid
exec YearEnd_Carryover_Vacation @DTE, @emplid
exec YearEnd_Accrual_Personal @DTE, @emplid