|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
|
Given this simple table:
start_date end_date event And this single record: 9/28/2005 10/2/2005 Conference Can I get this recordset? 9/28/2005 Conference 9/29/2005 Conference 9/30/2005 Conference 10/1/2005 Conference 10/2/2005 Conference DECLARE @StartDate datetime
DECLARE @EndDate datetime DECLARE @Type varchar(50) SET @StartDate = '9/28/2005' SET @EndDate = '10/2/2005' SET @Type = 'Conference' Create Table #Temp ( Appointmentdate datetime, AppointmentType varchar(50) ) While @startdate <= @EndDate BEGIN INSERT INTO #Temp Select @StartDate,@Type SET @StartDate = DATEADD(dd,1,@StartDate) END Select * from #temp HTH, Jens Suessmeyer hi chris,
kindly try this script use northwind declare @date1 as datetime,@date2 as datetime,@orderid varchar(200) select top 1 @orderid=orderid, @date1=orderdate,@date2=shippeddate from orders while datediff(dd,@date1,@date2)<>0 begin select @orderid as orderid,@date1 as shippeddate select @date1=DATEADD(dd,1,@Date1) end -- Show quotethanks, ------------------------------------ Jose de Jesus Jr. Mcp,Mcdba Data Architect Sykes Asia (Manila philippines) MCP #2324787 "Chris" wrote: > Given this simple table: > start_date > end_date > event > > And this single record: > 9/28/2005 > 10/2/2005 > Conference > > Can I get this recordset? > 9/28/2005 Conference > 9/29/2005 Conference > 9/30/2005 Conference > 10/1/2005 Conference > 10/2/2005 Conference > > > On Thu, 15 Sep 2005 22:05:09 -0400, Chris wrote:
Show quote >Given this simple table: Hi Chris,>start_date >end_date >event > >And this single record: >9/28/2005 >10/2/2005 >Conference > >Can I get this recordset? >9/28/2005 Conference >9/29/2005 Conference >9/30/2005 Conference >10/1/2005 Conference >10/2/2005 Conference > http://www.aspfaq.com/show.asp?id=2519 Best, Hugo -- (Remove _NO_ and _SPAM_ to get my e-mail address) |
|||||||||||||||||||||||