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 |
oasis1
Starting Member
35 Posts |
Posted - 2012-08-27 : 21:00:10
|
I am pulling pack the number of the week but want to display the weeks range value. I am able to get the numbers back how can I convert it to the date formatted range? mahalo, MarkSELECT convert(varchar(5), DATEPART(wk, GETDATE())* 7) + '-' + convert(varchar(5), DATEPART(wk, GETDATE())* 7 + 6) |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-08-27 : 21:23:26
|
[code]SELECT dateadd(wk,datediff(wk,0,getdate()),0) as weekstart,dateadd(wk,datediff(wk,0,getdate())+1,0)-1 as weekend[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|