Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert date range to seperate records

Status
Not open for further replies.

jamminjaymeyer

Programmer
May 23, 2001
88
0
0
US
I have this in my table:
fields: id, create_date, end_date
sample data: 12345, 9/12/08, 9/22/08

I need to turn that in to this:
ID Date
12345 9/12/08
12345 9/13/08
12345 9/14/08
12345 9/15/08
12345 9/16/08
12345 9/17/08
12345 9/18/08
12345 9/19/08
12345 9/20/08
12345 9/21/08
12345 9/22/08

Writing a seperate record for each date in the range that is stored.

Any ideas are appreciated.
 
Take a look here: thread183-1502355

Particular the post dated: 24 Sep 08 12:00

-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
You will need a date table which lists all dates in range

select t.id, d.date from
datetable d
left outer join on table t
on d.date >= t.create_date and d.date <= t.end_date

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top