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

Added an end date to a select statement based on the next record's start date 1

Status
Not open for further replies.

kernal

Technical User
Feb 27, 2001
415
US
I have a table that has start dates and end dates. I need to have a select statement that will add an end date based on the next record's start date (the day prior to the next record's end date):

table

id start_date end_date
1 2004-09-27 2004-12-31
2 2005-01-01 2005-03-14
3 2005-03-15 2005-04-19
4 2005-04-20 ....

Help is appreciated.

Thanks
 
I need to have a select statement that will add an end date based on the next record's start date (the day prior to the next record's end date):

Can't do that with a "SELECT" statement ... It has to be an INSERT statement to add values to a row or column, and a single query cannot "look ahead" a row/record and INSERT or UPDATE the current row.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top