select cast(dateadd(day,-day(getdate())+1,getdate()) as date) 当月第一天,
cast(dateadd(day,-1,datename(year,dateadd(month,1,getdate()))+datename(month,dateadd(month,1,getdate()))+'01') as date) 当月最后一天,
cast(datename(year,dateadd(month,1,getdate()))+datename(month,dateadd(month,1,getdate()))+'01' as date) 下月第一天,
cast(dateadd(day,-1,datename(year,dateadd(month,2,getdate()))+datename(month,dateadd(month,2,getdate()))+'01') as date) 下月最后一天
12 月,查询的格式 应该是 2015-01-01 这样 不