Click here to Skip to main content
15,889,216 members
Home / Discussions / Database
   

Database

 
GeneralRe: Problem with Execute query by EXEC(@string) Pin
Mycroft Holmes29-Oct-09 2:24
professionalMycroft Holmes29-Oct-09 2:24 
GeneralRe: Problem with Execute query by EXEC(@string) Pin
nainakarri29-Oct-09 2:35
nainakarri29-Oct-09 2:35 
AnswerRe: Problem with Execute query by EXEC(@string) Pin
soni uma29-Oct-09 2:44
soni uma29-Oct-09 2:44 
GeneralRe: Problem with Execute query by EXEC(@string) Pin
nainakarri29-Oct-09 2:47
nainakarri29-Oct-09 2:47 
GeneralRe: Problem with Execute query by EXEC(@string) Pin
Abhishek Sur29-Oct-09 11:58
professionalAbhishek Sur29-Oct-09 11:58 
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 
Hi,
I am struggling to get the week number and week day of the particular day. I know we can use Datepart function which is available in sql server 2008 to display the week number of the given date. but my situation is different. for example
Datepart(wk,'2009-12-30') gives 53 weeks
Datepart(wk,'2010-01-02') gives 1. but I wanted to display it as 54.
whenever the year is changing I need to add these week number to the previous year one.

In the below table Bugdate is the input, and weeknumber and startday of the week are the expected outputs.

BugDate ----- weeknumber ---- Startday of the Week
....
12/13/2008---- 50------------- 12/7/2008
12/14/2008---- 51------------- 12/14/2008
12/21/2008---- 52------------- 12/21/2008
12/23/2008---- 52------------- 12/21/2008
12/30/2008---- 53------------- 12/28/2008
1/2/2009------- 54------------- 12/28/2008
1/6/2009------- 55------------- 1/4/2009
...
12/20/2009---- 105------------ 12/20/2009
12/28/2009---- 106------------ 12/27/2009
1/1/2010------ 106------------ 12/27/2009

Can any one help me to solve this problem.
Thanks in advance.
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 
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 

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.