declare @ksrq datetime
set @ksrq='2011-2-1'

select dateadd(d,a.number,@ksrq) as fDate
from master..spt_values a where type = 'P'
and dateadd(d,a.number,@ksrq) >= convert(varchar(7),@ksrq,120)+'-01'
and dateadd(d,a.number,@ksrq) < convert(varchar(7),dateadd(mm,1,@ksrq),120)+'-01'

posted on 2012-09-24 08:25  承志软件.张  阅读(467)  评论(0编辑  收藏  举报