DATEADD(day, -1, DATEADD(month, 1,DATEADD(day,-DATEPART(day, GETDATE())+1,getdate() ))) --月末
DATEADD(month, 1,DATEADD(day,-DATEPART(day, GETDATE())+1,getdate() )) --月初
DATEADD(day, -1, DATEADD(month, 1,DATEADD(day,-DATEPART(day, GETDATE())+1,getdate() ))) --月末
DATEADD(month, 1,DATEADD(day,-DATEPART(day, GETDATE())+1,getdate() )) --月初
转载于:https://www.cnblogs.com/hubj/archive/2009/03/18/sql.html
来源:https://blog.csdn.net/weixin_30199169/article/details/99042657