Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 datename, month -1

Author  Topic 

masterdineen
Aged Yak Warrior

550 Posts

Posted - 2011-02-04 : 06:15:28
How do i select dataname month of getdate() -1

so now i would have January as a result

Kind Regards

Rob

MCTS / MCITP certified

MIK_2008
Master Smack Fu Yak Hacker

1054 Posts

Posted - 2011-02-04 : 06:18:56
select DATENAME (m,DATEADD (m,-1,getdate()))
Go to Top of Page

masterdineen
Aged Yak Warrior

550 Posts

Posted - 2011-02-04 : 06:32:59
thank you so much. Its taking me soooo long getting my head round the syntax
Go to Top of Page

MIK_2008
Master Smack Fu Yak Hacker

1054 Posts

Posted - 2011-02-04 : 06:38:15
yrw :)
Go to Top of Page
   

- Advertisement -