brians0friends
Technical User
DATA:
RMS_ID PLAN MOVEIN_DATE MOVEOUT_DATE
1 FLEXB 08/22/2002 12/18/2002
1 FLEXB 01/19/2003 03/22/2003
2 MP10 08/22/2002 11/13/2002
2 MP10 01/17/2003 03/22/2003
2 MP10 01/22/2003 05/22/2003
3 MP10 08/22/2002 11/15/2002
3 MP10 01/20/2003 03/25/2003
I am trying to write a query that looks at each grouping of "RMS_ID" and determines if the proceeding Corresponding "RMS_ID" "MOVEIN_DATE". Overlaps the previous corresponding "RMS_ID" Records "MOVEOUT_DATE".
For instance if you look at "RMS_ID" "2" the second record "MOVEIN_DATE" of "01/17/2003" does not come before the previous corresponding "RMS_ID" "2" "MOVEOUT_DATE" "11/13/2002"...BUT when you look the third record for "RMS_ID" "2" the "MOVEIN_DATE" is "01/22/2003" which comes before the previous corresponding "RMS_ID" "2" "MOVEOUT_DATE" of "03/22/2003"...In this case I would like all records overlapping (the second and third record for "RMS_ID" "2" to return back in the query.
RMS_ID PLAN MOVEIN_DATE MOVEOUT_DATE
1 FLEXB 08/22/2002 12/18/2002
1 FLEXB 01/19/2003 03/22/2003
2 MP10 08/22/2002 11/13/2002
2 MP10 01/17/2003 03/22/2003
2 MP10 01/22/2003 05/22/2003
3 MP10 08/22/2002 11/15/2002
3 MP10 01/20/2003 03/25/2003
I am trying to write a query that looks at each grouping of "RMS_ID" and determines if the proceeding Corresponding "RMS_ID" "MOVEIN_DATE". Overlaps the previous corresponding "RMS_ID" Records "MOVEOUT_DATE".
For instance if you look at "RMS_ID" "2" the second record "MOVEIN_DATE" of "01/17/2003" does not come before the previous corresponding "RMS_ID" "2" "MOVEOUT_DATE" "11/13/2002"...BUT when you look the third record for "RMS_ID" "2" the "MOVEIN_DATE" is "01/22/2003" which comes before the previous corresponding "RMS_ID" "2" "MOVEOUT_DATE" of "03/22/2003"...In this case I would like all records overlapping (the second and third record for "RMS_ID" "2" to return back in the query.