Hi All,
looking for some TSQL that will allow me to see if a date falls within a specific weekrange.
I'm going to be using the code on a trigger and need an event to fire only on the first day of the new year. So if I have a field called weekrange containing "12/30/2002 - 01/05/2003" I want to check if within that range that "01/01/2003" is in it.
This Trigger doesn't work but it is what I would like to have happen. Any help would be appreciated. Thanks.
------------------------------------------------------
CREATE TRIGGER [YearEndProcessing_Mgr] ON [TimeSheet_MGR_TBL]
FOR UPDATE
AS
DECLARE @netid varchar(6)
select @netid = netid from updated
DECLARE @DTE varchar(10)
select @DTE ='01/01/' + convert(char(4),year(left(weekrange,10))) from updated
If (select Approved from UPDATED) = 'Y' and
substring((select Approved from UPDATED),1,10)=@DTE
and (select netid from UPDATED)= @netid
exec YearEnd_Accrual_Vacation @DTE, @netid
exec YearEnd_Carryover_Vacation @DTE, @netid
exec YearEnd_Accrual_Personal @DTE, @netid
looking for some TSQL that will allow me to see if a date falls within a specific weekrange.
I'm going to be using the code on a trigger and need an event to fire only on the first day of the new year. So if I have a field called weekrange containing "12/30/2002 - 01/05/2003" I want to check if within that range that "01/01/2003" is in it.
This Trigger doesn't work but it is what I would like to have happen. Any help would be appreciated. Thanks.
------------------------------------------------------
CREATE TRIGGER [YearEndProcessing_Mgr] ON [TimeSheet_MGR_TBL]
FOR UPDATE
AS
DECLARE @netid varchar(6)
select @netid = netid from updated
DECLARE @DTE varchar(10)
select @DTE ='01/01/' + convert(char(4),year(left(weekrange,10))) from updated
If (select Approved from UPDATED) = 'Y' and
substring((select Approved from UPDATED),1,10)=@DTE
and (select netid from UPDATED)= @netid
exec YearEnd_Accrual_Vacation @DTE, @netid
exec YearEnd_Carryover_Vacation @DTE, @netid
exec YearEnd_Accrual_Personal @DTE, @netid