JimF is correct DATEADD is what you needYou will probably want to do that with an After Insert trigger.Here is an example query with the use of dateadd.
Create Table #TempEmployee( empID int, empIN datetime, empOUT datetime);Insert into #TempEmployee Values(1,'2010-12-20 08:00','2010-12-20 16:00');Insert into #TempEmployee Values(2,'2010-12-20 08:00','2010-12-20 16:00');Insert into #TempEmployee Values(3,'2010-12-20 08:00','2010-12-20 16:00');Insert into #TempEmployee Values(4,'2010-12-20 08:00','2010-12-20 16:00');Insert into #TempEmployee Values(5,'2010-12-20 08:00','2010-12-20 16:00');Insert into #TempEmployee Values(6,'2010-12-20 08:00','2010-12-20 16:00');Update #TempEmployee Set empIN = (Dateadd(mi,15,empIN)), empOUT = (Dateadd(mi,15,empOUT)) Where empID = 1Select *From #TempEmployee;Drop Table #TempEmployee;
empID empIN empOUT----------- ----------------------- -----------------------1 2010-12-20 08:15:00.000 2010-12-20 16:15:00.0002 2010-12-20 08:00:00.000 2010-12-20 16:00:00.0003 2010-12-20 08:00:00.000 2010-12-20 16:00:00.0004 2010-12-20 08:00:00.000 2010-12-20 16:00:00.0005 2010-12-20 08:00:00.000 2010-12-20 16:00:00.0006 2010-12-20 08:00:00.000 2010-12-20 16:00:00.000
Thank You,John