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 |
|
lols
Posting Yak Master
174 Posts |
Posted - 2009-04-30 : 23:35:32
|
| I want the simplest way to generate the dates of the last 2 months from today in the following manner:1 May 200930 Apr 200929 Apr 2009...31 Mar 200929 Mar 2009...2 Mar 2009Please tell me the query for this |
|
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
Posted - 2009-04-30 : 23:40:06
|
| is this u wantselect convert(varchar(32),getdate()-number,106)from master..spt_valueswhere type ='p' and number <=60 |
 |
|
|
lols
Posting Yak Master
174 Posts |
Posted - 2009-05-01 : 00:20:28
|
| Excellent Bklr! you Rock!! |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
|
|
|
|
|