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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Help with a date between

Author  Topic 

gavakie
Posting Yak Master

221 Posts

Posted - 2009-01-22 : 11:35:41
I need to come up with a date between for
prior week period of Friday through Thursday

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-01-22 : 11:50:28
[code]select * from table where date >=dateadd(wk,datediff(wk,0,getdate())-1,0)-2 and date<dateadd(wk,datediff(wk,0,getdate()),0)-2[/code]
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-01-22 : 11:56:16
i'm assuming your datefirst setting is us default which is 7
Go to Top of Page
   

- Advertisement -