Click here to Skip to main content
15,895,142 members
Home / Discussions / Database
   

Database

 
GeneralRe: Problem with Execute query by EXEC(@string) Pin
nainakarri29-Oct-09 18:34
nainakarri29-Oct-09 18:34 
AnswerRe: Problem with Execute query by EXEC(@string) Pin
NIRMAL UPADHYAY30-Oct-09 20:04
NIRMAL UPADHYAY30-Oct-09 20:04 
Questionhow to get week number and startday of the week in sql server 2008 Pin
chakran28-Oct-09 23:40
chakran28-Oct-09 23:40 
AnswerRe: how to get week number and startday of the week in sql server 2008 Pin
Mycroft Holmes29-Oct-09 0:33
professionalMycroft Holmes29-Oct-09 0:33 
GeneralRe: how to get week number and startday of the week in sql server 2008 Pin
chakran29-Oct-09 0:45
chakran29-Oct-09 0:45 
GeneralRe: how to get week number and startday of the week in sql server 2008 Pin
Mycroft Holmes29-Oct-09 2:03
professionalMycroft Holmes29-Oct-09 2:03 
GeneralRe: how to get week number and startday of the week in sql server 2008 Pin
chakran30-Oct-09 1:09
chakran30-Oct-09 1:09 
GeneralRe: how to get week number and startday of the week in sql server 2008 Pin
Niladri_Biswas30-Oct-09 1:45
Niladri_Biswas30-Oct-09 1:45 
But as per the query which I have given it should be

Date-------- weekNumber
2011-12-31-- 212 and not 157
2012-01-01-- 213 and not 157 or 158
2012-01-02-- 213 and not 157 or 158

And it is correct only. Even I calculated the value.

Only change the case statement by the following lines

case when Datepart(yy,bugdate) = 2009 then Datepart(wk,bugdate) + 53*1
		     when Datepart(yy,bugdate) = 2010 then Datepart(wk,bugdate) + 53*2
		     when Datepart(yy,bugdate) = 2011 then Datepart(wk,bugdate) + 53*3
		     when Datepart(yy,bugdate) = 2012 then Datepart(wk,bugdate) + 53*4
		else Datepart(wk,bugdate)
		end as weeknumber		

Smile | :)

Niladri Biswas

GeneralRe: how to get week number and startday of the week in sql server 2008 Pin
chakran30-Oct-09 2:20
chakran30-Oct-09 2:20 
GeneralRe: how to get week number and startday of the week in sql server 2008 Pin
Niladri_Biswas30-Oct-09 3:36
Niladri_Biswas30-Oct-09 3:36 
GeneralRe: how to get week number and startday of the week in sql server 2008 Pin
chakran30-Oct-09 4:06
chakran30-Oct-09 4:06 
GeneralRe: how to get week number and startday of the week in sql server 2008 Pin
Niladri_Biswas30-Oct-09 5:11
Niladri_Biswas30-Oct-09 5:11 
GeneralRe: how to get week number and startday of the week in sql server 2008 Pin
chakran1-Nov-09 21:05
chakran1-Nov-09 21:05 
AnswerRe: how to get week number and startday of the week in sql server 2008 [modified] Pin
Niladri_Biswas29-Oct-09 22:30
Niladri_Biswas29-Oct-09 22:30 
Questiondatabase Pin
sydneylandscaper28-Oct-09 21:56
sydneylandscaper28-Oct-09 21:56 
AnswerRe: database Pin
WoutL28-Oct-09 22:48
WoutL28-Oct-09 22:48 
AnswerRe: database Pin
dan!sh 29-Oct-09 0:23
professional dan!sh 29-Oct-09 0:23 
AnswerRe: database Pin
Mycroft Holmes29-Oct-09 0:25
professionalMycroft Holmes29-Oct-09 0:25 
AnswerRe: database Pin
dxlee29-Oct-09 4:16
dxlee29-Oct-09 4:16 
AnswerRe: database Pin
dreamaway82029-Oct-09 5:46
dreamaway82029-Oct-09 5:46 
AnswerRe: database Pin
Eddy Vluggen29-Oct-09 9:29
professionalEddy Vluggen29-Oct-09 9:29 
QuestionThe Saga Continues Pin
Roger Wright28-Oct-09 21:45
professionalRoger Wright28-Oct-09 21:45 
QuestionHow to seperate records Pin
kKamel28-Oct-09 20:35
kKamel28-Oct-09 20:35 
AnswerRe: How to seperate records Pin
Mycroft Holmes29-Oct-09 0:14
professionalMycroft Holmes29-Oct-09 0:14 
GeneralRe: How to seperate records Pin
kKamel29-Oct-09 0:44
kKamel29-Oct-09 0:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.