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

Database

 
GeneralRe: SQL Server 2008 R2 Community Preview Now Available To All Pin
Jerry Hammond12-Aug-09 19:14
Jerry Hammond12-Aug-09 19:14 
QuestionSQL 2005 Problem : Insert exec statement cannot be nested Pin
mihirhp12-Aug-09 0:49
mihirhp12-Aug-09 0:49 
AnswerRe: SQL 2005 Problem : Insert exec statement cannot be nested Pin
Jerry Hammond12-Aug-09 3:58
Jerry Hammond12-Aug-09 3:58 
GeneralRe: SQL 2005 Problem : Insert exec statement cannot be nested Pin
Mycroft Holmes12-Aug-09 16:58
professionalMycroft Holmes12-Aug-09 16:58 
GeneralRe: SQL 2005 Problem : Insert exec statement cannot be nested Pin
Luc Pattyn12-Aug-09 17:01
sitebuilderLuc Pattyn12-Aug-09 17:01 
GeneralRe: SQL 2005 Problem : Insert exec statement cannot be nested Pin
_Damian S_12-Aug-09 17:25
professional_Damian S_12-Aug-09 17:25 
JokeRe: SQL 2005 Problem : Insert exec statement cannot be nested Pin
dan!sh 12-Aug-09 18:46
professional dan!sh 12-Aug-09 18:46 
QuestionSQL 2000 Query Pin
CodingYoshi11-Aug-09 11:26
CodingYoshi11-Aug-09 11:26 
I have a table with these fields:
Season      Day         DateStart         DateEnd         WeekNumber         MonthNumber         MonthName         Year
S               Sunday      2/1/2009         2/1/2009         1                        1                        February            2009
F               Saturday   1/31/2009         1/31/2009      53                     12                        January            2009
.
.
.


This is a daily fiscal calendar. I need to get the season, Day the season started, Date of the season start, Date of the season end, week number of season start, month name of season start, and the year of season start. Because this is daily calendar I am thinking I can get the MIN(DateStart), and WeekNumber grouped by WeekNumber and year.
Season   Date_Start Week_Number Month_Number      Month                  Year
S     2001-01-28     1     1                 February        2001
S     2002-01-27      1     1                 February        2002
S     2003-01-26      1     1                 February        2003
S     2004-02-01      1     1                 February        2004
S     2005-01-30      1     1                 February        2005
S     2006-01-29      1     1                 February        2006
S     2007-01-28      1     1                 February        2007
S     2008-01-27      1     1                 February        2008
S     2009-02-01      1     1                 February        2009

Now I know the start date. I can also get the End date of each season by getting the MAX(DateEnd), and WeekNumber grouped by WeekNumber and Year.

S     2001-07-28 00:00:00     26     6     July     2001
S     2002-07-27 00:00:00     26     6     July     2002
S     2003-07-26 00:00:00     26     6     July     2003
F     2004-07-31 00:00:00     26     6     July     2004
S     2005-07-30 00:00:00     26     6     July     2005
S     2006-07-29 00:00:00     26     6     July     2006
S     2007-07-28 00:00:00     26     6     July     2007
S     2008-07-26 00:00:00     26     6     July     2008
S     2009-08-01 00:00:00     26     6     July     2009

Now I know both start dates of each season, and end dates of each season. For example, in 2001 Spring season starts on first line of first table, and ends on first line of second table. How can I put it together into one table? Basically I need to match them by row number but I don't know how to do so in SQL 2000? This is the final result set structure I need but the data is not correct:
Season   Date_Start                     Date_End                        Week_Num Month_Num         Month_Name         Year
S     2001-01-28 00:00:00     2001-07-28 00:00:00     1     1     February     2001
S     2001-01-28 00:00:00     2002-07-27 00:00:00     1     1     February     2001
S     2001-01-28 00:00:00     2003-07-26 00:00:00     1     1     February     2001
S     2001-01-28 00:00:00     2004-07-31 00:00:00     1     1     February     2001

CodingYoshi

Artificial Intelligence is no match for Human Stupidity.

AnswerRe: SQL 2000 Query Pin
Syed Mehroz Alam11-Aug-09 21:36
Syed Mehroz Alam11-Aug-09 21:36 
GeneralRe: SQL 2000 Query Pin
CodingYoshi12-Aug-09 3:00
CodingYoshi12-Aug-09 3:00 
QuestionOf databases and the sacrifice of live chickens Pin
gantww11-Aug-09 9:31
gantww11-Aug-09 9:31 
AnswerRe: Of databases and the sacrifice of live chickens Pin
Mycroft Holmes11-Aug-09 15:01
professionalMycroft Holmes11-Aug-09 15:01 
GeneralRe: Of databases and the sacrifice of live chickens Pin
gantww12-Aug-09 3:09
gantww12-Aug-09 3:09 
AnswerRe: Of databases and the sacrifice of live chickens Pin
David Skelly11-Aug-09 22:36
David Skelly11-Aug-09 22:36 
AnswerRe: Of databases and the sacrifice of live chickens Pin
WoutL12-Aug-09 20:06
WoutL12-Aug-09 20:06 
Questiontwo questions regarding a big database table Pin
Seraph_summer11-Aug-09 8:48
Seraph_summer11-Aug-09 8:48 
AnswerRe: two questions regarding a big database table Pin
David Mujica11-Aug-09 10:12
David Mujica11-Aug-09 10:12 
AnswerRe: two questions regarding a big database table Pin
Mycroft Holmes11-Aug-09 15:09
professionalMycroft Holmes11-Aug-09 15:09 
QuestionSQL DATABASE Pin
kibromg11-Aug-09 6:43
kibromg11-Aug-09 6:43 
AnswerRe: SQL DATABASE Pin
Hristo-Bojilov13-Aug-09 5:04
Hristo-Bojilov13-Aug-09 5:04 
QuestionCase Sensitive User Name Pin
janani1311-Aug-09 2:38
janani1311-Aug-09 2:38 
AnswerRe: Case Sensitive User Name Pin
Luc Pattyn11-Aug-09 3:30
sitebuilderLuc Pattyn11-Aug-09 3:30 
QuestionHow to change the default port 1433 for SQLServer 2008 Pin
Paramu197311-Aug-09 1:03
Paramu197311-Aug-09 1:03 
AnswerRe: How to change the default port 1433 for SQLServer 2008 Pin
Paramu197311-Aug-09 4:18
Paramu197311-Aug-09 4:18 
QuestionHow to Concate more than one rows in one row ?. Pin
Fazal Vahora10-Aug-09 21:41
Fazal Vahora10-Aug-09 21:41 

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.