Click here to Skip to main content
15,888,968 members
Home / Discussions / Database
   

Database

 
GeneralRe: database design Pin
dan!sh 3-Dec-09 18:31
professional dan!sh 3-Dec-09 18:31 
QuestionSqlite (Max Value) Pin
jashimu3-Dec-09 3:56
jashimu3-Dec-09 3:56 
AnswerRe: Sqlite (Max Value) Pin
loyal ginger3-Dec-09 4:03
loyal ginger3-Dec-09 4:03 
GeneralRe: Sqlite (Max Value) Pin
jashimu3-Dec-09 4:45
jashimu3-Dec-09 4:45 
GeneralRe: Sqlite (Max Value) Pin
jashimu3-Dec-09 5:49
jashimu3-Dec-09 5:49 
GeneralRe: Sqlite (Max Value) Pin
dan!sh 3-Dec-09 6:03
professional dan!sh 3-Dec-09 6:03 
GeneralRe: Sqlite (Max Value) Pin
Mycroft Holmes3-Dec-09 14:03
professionalMycroft Holmes3-Dec-09 14:03 
QuestionHow to get currect number of weeks for the given date considering when 31st december is saturday Pin
chakran2-Dec-09 20:06
chakran2-Dec-09 20:06 
Hi,
I have a situation where I wanted to have the weekno for the given date.
If year is changing then weekno should add with the previous weekno.
Below is the table contains two columns, Bug date and corresponding weeknumber... till 12/31/2011 I am getting correctly but after that am getting wrong result.   for 01/01/2012 the weeknumber should be 158 but am getting 157, can any one help me solve this problem..Pls see my logic below... am using sql server 2008.

Bug Date      weeknumber
10/25/2009     44
11/01/2009     45
12/30/2009     53
12/31/2009     53
01/01/2010     53
01/03/2010     54
12/30/2010     105
12/31/2010     105
01/01/2011     105
01/02/2011     106
01/04/2011     106
12/30/2011     157
12/31/2011     157
01/01/2012     158
01/08/2012     158

DECLARE @FirstDate char(20)    
DECLARE @baseyear char(20)    
SET @FirstDate =(SELECT Min(Bugdate) FROM BugsDB_DefectVolume)
SET @baseyear=(SELECT Datepart(year,@FirstDate))   //am considering the first date as base year.

UPDATE BugsDB_DefectVolume
SET weeknumber= Datepart(wk,@BugDate) + ((Datepart(year,@BugDate) - @baseyear) *52),
StartDayofWeek=DATEadd(day, (1- DATEPART(dw,@BugDate)), @BugDate)
WHERE BugDate=@BugDate and [Product ID]=@ProductID
AnswerRe: How to get currect number of weeks for the given date considering when 31st december is saturday Pin
WoutL2-Dec-09 21:56
WoutL2-Dec-09 21:56 
GeneralRe: How to get currect number of weeks for the given date considering when 31st december is saturday Pin
chakran2-Dec-09 22:01
chakran2-Dec-09 22:01 
GeneralRe: How to get currect number of weeks for the given date considering when 31st december is saturday Pin
WoutL2-Dec-09 23:36
WoutL2-Dec-09 23:36 
AnswerRe: How to get currect number of weeks for the given date considering when 31st december is saturday Pin
David Skelly2-Dec-09 22:49
David Skelly2-Dec-09 22:49 
GeneralRe: How to get currect number of weeks for the given date considering when 31st december is saturday Pin
Mycroft Holmes3-Dec-09 14:00
professionalMycroft Holmes3-Dec-09 14:00 
QuestionNewbie question Pin
NAB372-Dec-09 8:48
NAB372-Dec-09 8:48 
AnswerDid you see my response in the VB.NET forum ? Pin
David Mujica2-Dec-09 9:05
David Mujica2-Dec-09 9:05 
GeneralRe: Did you see my response in the VB.NET forum ? Pin
NAB372-Dec-09 15:24
NAB372-Dec-09 15:24 
AnswerRe: Newbie question Pin
Blue_Boy2-Dec-09 9:21
Blue_Boy2-Dec-09 9:21 
QuestionImport Export Wizard problem Pin
RajpootRohan1-Dec-09 23:03
professionalRajpootRohan1-Dec-09 23:03 
AnswerRe: Import Export Wizard problem Pin
Corporal Agarn2-Dec-09 1:24
professionalCorporal Agarn2-Dec-09 1:24 
AnswerRe: Import Export Wizard problem Pin
Mycroft Holmes2-Dec-09 12:16
professionalMycroft Holmes2-Dec-09 12:16 
AnswerRe: Import Export Wizard problem Pin
Robin_Roy2-Dec-09 19:01
Robin_Roy2-Dec-09 19:01 
QuestionEscape character for hyphen in SQL Pin
hvgyufg28fh38tyr78hf1-Dec-09 20:44
hvgyufg28fh38tyr78hf1-Dec-09 20:44 
AnswerRe: Escape character for hyphen in SQL Pin
Niladri_Biswas1-Dec-09 21:44
Niladri_Biswas1-Dec-09 21:44 
QuestionReturn value from a stored procedure Pin
Member 42602701-Dec-09 19:45
Member 42602701-Dec-09 19:45 
AnswerRe: Return value from a stored procedure Pin
_Damian S_1-Dec-09 19:58
professional_Damian S_1-Dec-09 19:58 

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.