select convert(varchar(10),dateadd(dd,number,dateadd(month,-1,getdate())),120) as dtfrom master..spt_values where type='P' and dateadd(dd,number,dateadd(month,-1,getdate()))<=getdate()--------------------- 作者:a-b-d 来源:CSDN 原文:https://blog.csdn.net/a6…