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.
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 applicationI would greatly appreciate help on thisKKM |
|
jdaman
Constraint Violating Yak Guru
354 Posts |
Posted - 2008-02-06 : 14:41:51
|
What date would you want returned for August 31 2007? |
 |
|
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? |
 |
|
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 responseI 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 |
 |
|
sunil
Constraint Violating Yak Guru
282 Posts |
Posted - 2008-02-07 : 08:42:59
|
tryselect datename(m,DATEADD(MONTH, -6, GETDATE())) |
 |
|
|
|
|