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 Development (2000)
 Expanding query rows

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-05-13 : 01:47:39
Steve writes "I have a table containing events with the following columns:

PKId INT,
Title varchar(50),
StartDate datetime,
EndDate datetime

The start and end dates can be on different days. I want a query that will return one row for each day a particular event will occur. For example, the table contains the following 2 rows:

PKID Title StartDate EndDate
---- ---------------- ------------------ -----------------
1 Single Day Event 5/7/2002 10:00 AM 5/7/2002 11:00 AM
2 Multi-Day Event 5/7/2002 8:00 AM 5/9/2002 5:00 PM

I want a query that will return the following results:

PKID Title StartDate
---- --------------- ------------------
1 Single Day Event 5/7/2002 10:00 AM
2 Multi-Day Event 5/7/2002 8:00 AM
2 Multi-Day Event 5/8/2002 8:00 AM
2 Multi-Day Event 5/9/2002 8:00 AM"

YellowBug
Aged Yak Warrior

616 Posts

Posted - 2002-05-13 : 05:34:25
This sounds very similiar to this post:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=15616

Hmmm...

Go to Top of Page
   

- Advertisement -