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)
 Operation on getdate()

Author  Topic 

kkm
Starting Member

15 Posts

Posted - 2008-02-06 : 14:35:05
This month is February. I want to get Septmeber month of 2007.Basically I am going back to by 6 months from getdate().I want to use this dynamic value as aparameter in dash board application
I would greatly appreciate help on this
KKM

jdaman
Constraint Violating Yak Guru

354 Posts

Posted - 2008-02-06 : 14:41:51
What date would you want returned for August 31 2007?
Go to Top of Page

Lamprey
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2008-02-06 : 14:57:13
DATEADD(MONTH, -6, GETATE())

Are you trying to get the start and end dates for September or just the date that is 6 months ago?
Go to Top of Page

kkm
Starting Member

15 Posts

Posted - 2008-02-07 : 08:36:59
quote:
Originally posted by Lamprey

DATEADD(MONTH, -6, GETATE())

Are you trying to get the start and end dates for September or just the date that is 6 months ago?


Thank you for the response
I am interested in just getting a month ( for example Sep ) which is the month 6 months ago since I want use this value as a parameter in the dashboard application.
I think now I can go with
select month(DATEADD(MONTH, -6, GETDATE()))

Thank you once again.
KKM
Go to Top of Page

sunil
Constraint Violating Yak Guru

282 Posts

Posted - 2008-02-07 : 08:42:59
try
select datename(m,DATEADD(MONTH, -6, GETDATE()))
Go to Top of Page
   

- Advertisement -