标签:时间 from pre into val select name 时间段 add
查询说时间段内所有周六日
DECLARE @t TABLE(date0 DATETIME) DECLARE @st DATETIME,@et DATETIME SET @st=‘2007-01-01‘ SET @et=‘2008-01-01‘ WHILE @st <@et BEGIN INSERT INTO @t VALUES(@st) SELECT @st=DATEADD(DAY,1,@st) END SELECT date0,DATENAME(weekday,date0) FROM @t WHERE DATEPART(weekday,date0+@@DATEFIRST-1) IN (6,7)
标签:时间 from pre into val select name 时间段 add
原文地址:http://www.cnblogs.com/huanglibin/p/7050454.html