DECLARE @min DATETIME
DECLARE @max DATETIME
DECLARE @now DATETIME
SET @now = GETDATE();
SET @min = CONVERT(VARCHAR(25),DATEADD(dd
--get the last day of last month
SET @max = CONVERT(VARCHAR(25),DATEADD(dd
,-(DAY(@now)),@now),101)
--get the first day of current month
SET @min = CONVERT(VARCHAR(25),DATEADD(dd
,-(DAY(@now)-1),@now),101) --get the last day of current month
SET @max = CONVERT(VARCHAR(25),DATEADD(dd
,-(DAY(DATEADD(mm,1,@now))),DA
No comments:
Post a Comment