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 |
0341
Starting Member
21 Posts |
Posted - 2007-08-28 : 10:39:45
|
I am trying to write a query that returns the date of the previous monday regardless of what day of the week it's run on. Any help would be greatly appreciated.Thanks,Phil |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-08-28 : 10:52:51
|
[code]SELECT DATEADD(WEEK, DATEDIFF(WEEK, 0, CURRENT_TIMESTAMP), 0), DATEADD(WEEK, DATEDIFF(WEEK, 7, CURRENT_TIMESTAMP), 0)[/code] E 12°55'05.25"N 56°04'39.16" |
 |
|
0341
Starting Member
21 Posts |
Posted - 2007-08-28 : 10:59:23
|
Thank you Peso! That worked. |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
|
|
|