--AYIN ILK GUNU VE SON GUNU select CONVERT(VARCHAR(10),DATEADD(month, DATEDIFF(month, 0, SYSDATETIME()), 0),120)--AYIN ILK GUNU select CONVERT(VARCHAR(10),DATEADD(month, DATEDIFF(month, 0, SYSDATETIME())+1, 0)-1,120)--AYIN SON GUNU --IKI AY ONCENIN ILK GUNU VE SON GUNU select CONVERT(VARCHAR(10),DATEADD(month, DATEDIFF(month, 0, SYSDATETIME())-2, 0),120) select CONVERT(VARCHAR(10),DATEADD(month, DATEDIFF(month, 0, SYSDATETIME())-1, 0)-1,120) --ORNEK USE WEBSERVICE DECLARE @calldate AS VARCHAR(100), @calldate2 AS VARCHAR(100) SET @calldate=CONVERT(VARCHAR(10),DATEADD(month, DATEDIFF(month, 0, SYSDATETIME())-2, 0),120) SET @calldate2=CONVERT(VARCHAR(10),DATEADD(month, DATEDIFF(month, 0, SYSDATETIME())-1, 0),120) SELECT * FROM dbo.WebServiceCallLog WHERE CallDate>=@calldate and CallDate<=@calldate2