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 2000 Forums
 SQL Server Administration (2000)
 Correct date

Author  Topic 

tedew
Starting Member

22 Posts

Posted - 2005-11-25 : 04:26:18
hello,
When I'm doing :

Select datepart(wk,'2005-11-25') I'm geting 48 week - but now it's 47 week
Why SQL SREVER returns 48 week while now it's 47 week ??

bye

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2005-11-25 : 04:37:17
The week (wk, ww) datepart reflects changes made to SET DATEFIRST. January 1 of any year defines the starting number for the week datepart, for example: DATEPART(wk, 'Jan 1, xxxx') = 1, where xxxx is any year.

refer to the BookOnline on datepart for details.
this will give u 48
set datefirst 1
select datepart(wk, '2005-11-25')


-----------------
[KH]
Go to Top of Page
   

- Advertisement -