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
steveb.
SSC-Forever
Points: 46733
More actions
December 8, 2009 at 6:59 am
#1089182
you can use the dateadd function combined with datename
http://msdn.microsoft.com/en-us/library/ms186819.aspx
SELECT DATENAME(m,(DATEADD(m,-1,GETDATE())))