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 |
|
daniel50096230
Yak Posting Veteran
99 Posts |
Posted - 2011-07-20 : 03:48:16
|
| Hi, I had a stored procedure that accept one date. Then I want to get last Sunday of the date. For example, I pass in '2011-01-01'. The previous Sunday of '2011-01-01' should be '2010-12-26'...How can I use SQL to get this? |
|
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2011-07-20 : 04:33:31
|
| Previous Sunday:select dateadd(day, 1 - datepart(dw, getdate()), getdate())Just change getdate() with your date field. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
|
|
|