Sherzy
3/17/2016 - 4:39 PM

Dates

Dates

Update  [SST_Wayzata].[dbo].[RCBlock]
 SET EndTime = DATEADD(MINUTE, 10, EndTime) 
 where [RCBlockTypeId] = 6 and StartTime > '2018-06-07 15:20:00.0000000'
Update CompetitionEventComponent 
set StartTime = DATEADD(day,364,StartTime),
EndTime = DATEADD(day,364,EndTime),
LunchStart = DATEADD(day,364,LunchStart),
LunchEnd = DATEADD(day,364,LunchEnd),
BreakStart = DATEADD(day,364,BreakStart),
BreakEnd = DATEADD(day,364,BreakEnd)
where StartTime < '2013-01-13 00:00:00.0000000' 
  and StartTime NOT BETWEEN '2013-03-01 00:00:00.0000000' AND '2013-03-01 23:00:00.0000000'
  
Begin Tran
Update CompetitionEventComponent 
SET [Date] = DATEADD(day,364,[Date])
where StartTime > '2013-01-13 00:00:00.0000000' and [DATE] < '2013-01-13 00:00:00.0000000'

Commit
-- Update the date only, keep time

UPDATE CEC
set 
Date = '2016-03-04 00:00:00.0000000',
StartTime = CAST('03/04/2016' AS datetime) + cast(cast(StartTime as time) AS DATETIME),
EndTime = CAST('03/04/2016' AS datetime) + cast(cast(EndTime as time) AS DATETIME)
--select *
FROM [CTS].[dbo].[CompetitionEventComponent] CEC
join CTS.dbo.CompetitionEvent CE on CE.[CompetitionEventId] = CEC.[CompetitionEventId]
where CE.CompetitionId = 65 and DayOfConference = -2