if datepart(hour,getdate()) >= 19 and datepart(hour,getdate()) <= 22 begin declare @d varchar(8) select @d = convert(varchar(100), cast(convert(varchar(100), getdate(), 23) AS datetime),108) select @d = left(@d,7) + cast(datepart(S,getdate()) % 6 AS varchar) waitfor delay @d end KMTSCP KMVSL SXYCED YXSYGJ