EricLynnWright
asked on
Get Prior Month Number
Seeing if anyone has SQL on how to get the prior month (as a number) by using today's date.
So for this month, it would come back as 4. In january, it would come back as 12.
etc....
So for this month, it would come back as 4. In january, it would come back as 12.
etc....
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SELECT DATEPART(mm,DATEADD(mm,-1, getdate()) )
ASKER
Thank you for the posts.
anujnb - he beat you by just a minute. But I certainly appreciate the help.
anujnb - he beat you by just a minute. But I certainly appreciate the help.
Thanks