当月月末最后一天的日期的语句,请看看还有没有问题或更好的方法
DECLARE
@Endyear int,
@endmonth int
set @Endyear =2013
set @endmonth=4
select cast(cast(@Endyear as varchar(50))+ '-' +cast(@endmonth+1 as varchar(50)) + '-1' As datetime) - 1
日期,
------解决方案--------------------select dateadd(day,-1,convert(varchar(9),dateadd(month,1,getdate()),120) + '01')