查询当月天数

查询当月天数:

select   datepart ( day , dateadd ( day , - 1 , dateadd ( month , 1 , cast ( cast ( year ( getdate ())  as   varchar ) + ' - ' + cast ( month ( getdate ())  as   varchar ) + ' -01 '   as   datetime ))))

 

你可能感兴趣的:(查询当月天数)