Home Forums SQL Server 2005 SQL Server 2005 General Discussion select the last month in SQL server 2005 RE: select the last month in SQL server 2005
purushotham.k9
SSCommitted
Points: 1992
More actions
December 8, 2009 at 7:58 am
#1089245
For this i am using following SQL: CAST(DATEPART(yyyy,getdate()) as varchar) + '-' + CONVERT(varchar(3),DATENAME(m,(DATEADD(m,-1,getdate())))).
I am gussing that this should give the proper result