DECLARE @StartTime AS DATETIME
SET @StartTime= '2016-5-10 '
DECLARE @t
TABLE(dDate DATETIME) --计算连续时间
WHILE @StartTime <= '2016-5-13 '
BEGIN
INSERT INTO @t SELECT @StartTime
SET @StartTime=Dateadd(day,1,@StartTime)
END
SELECT * FROM @t
SELECT CONVERT(varchar(100),T0.dDate ,23) FROM @t T0