DECLARE @mydate DATETIME
Declare @save datetime
SELECT @mydate = '08/13/2011'
SELECT CONVERT(VARCHAR(25),DATEADD(dd,-(DAY(@mydate)),@mydate),101) ,
'Last Day of Previous Month'
UNION
SELECT CONVERT(VARCHAR(25),dateadd(m,-1,DATEADD(dd,-(DAY(getdate())-1),getdate())),103) AS Date_Value,
'First Day of Last Month' AS Date_Type
Declare @save datetime
SELECT @mydate = '08/13/2011'
SELECT CONVERT(VARCHAR(25),DATEADD(dd,-(DAY(@mydate)),@mydate),101) ,
'Last Day of Previous Month'
UNION
SELECT CONVERT(VARCHAR(25),dateadd(m,-1,DATEADD(dd,-(DAY(getdate())-1),getdate())),103) AS Date_Value,
'First Day of Last Month' AS Date_Type
No comments:
Post a Comment