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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Split - Help pls

Status
Not open for further replies.

taskchat

Technical User
Nov 5, 2002
2
US
hi Sql Gurus,
This is challenging sql for me , i hope you could solve this.

I have a table with following info

SDate EDate Value
10/10/2002 10/15/2002 15
10/12/2002 10/14/2002 28
10/20/2002 10/30/2002 30

Sql should return like this
SDate EDate Value
10/10/2002 10/11/2002 15
10/12/2002 10/14/2002 28
10/15/2002 10/15/2002 15
10/20/2002 10/30/2002 30

The task is to split the records if the date range is overlapped. If it's fully overlapped sql should return one record for the overlapping.

Any help/suggestion is appreciated.
[Cursor/dynamic sql also okay for me]

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top