1 declare @currentFirst 2 datetime declare @currentLast 3 datetime set @currentFirst=DATEADD(month,datediff(month,0,GETDATE()),0) 4 set @currentLast=dateadd(second,-1,DATEADD(month,datediff(month,-1,GETDATE()),0)) 5 select @currentFirst --第一天 6 select @currentLast --最后一天