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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 nth week of a date

Author  Topic 

jeff06
Posting Yak Master

166 Posts

Posted - 2009-02-11 : 16:08:47
I have a date, how to find which week this date is in?
week 1, week2 ----week 56

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-02-11 : 16:45:11
What defines a week for you?
How do you define the rules when starting over for week 1 during New Year?



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

jeff06
Posting Yak Master

166 Posts

Posted - 2009-02-11 : 21:36:35
I want calandar week.
for example.
Jan 1-3, 2009 week1
Jan 4-10, 2009 week 2
Jan 11-17,2009 week 3

for any date, which week is it?
THANKS
Go to Top of Page

Jai Krishna
Constraint Violating Yak Guru

333 Posts

Posted - 2009-02-11 : 22:55:17
select datepart(ww,date)

select datepart(ww,'01/03/2009')

Jai Krishna
Go to Top of Page
   

- Advertisement -