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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Month -3

Author  Topic 

rwlopez
Yak Posting Veteran

80 Posts

Posted - 2007-01-05 : 16:57:58
What is the cleanest way to find the month number three months ago? I thought I could use MONTH(GetDate())-3, but this is January so it returns -2 for the Month Number.

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2007-01-05 : 17:12:33
how's this?

select month(dateadd(month, -3, getdate()))

Be One with the Optimizer
TG
Go to Top of Page

rwlopez
Yak Posting Veteran

80 Posts

Posted - 2007-01-05 : 17:16:43
Perfect. That's what I was looking for. Thanks for your help!
Go to Top of Page
   

- Advertisement -