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 |
|
qutesanju
Posting Yak Master
193 Posts |
Posted - 2010-07-01 : 03:46:01
|
| i have to find some back datese.g if given date 2010-07-01how can i find date 2009-01-01(this should be year-2 and it's start Jan 01)e.g from select dateadd(year,-2,getdate()) -->output is 2008-07-01 02:40:08.123but i wish to find 2009-01-01 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-07-01 : 04:50:07
|
| select dateadd(year,datediff(year,0,'20100701')-1,0)MadhivananFailing to plan is Planning to fail |
 |
|
|
qutesanju
Posting Yak Master
193 Posts |
Posted - 2010-07-01 : 08:50:12
|
| thanks Madhivanan!!! |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-07-01 : 10:35:42
|
quote: Originally posted by qutesanju thanks Madhivanan!!!
You are welcome MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|