SQL Help!!!

SoftwareDude

Beta member
Messages
1
I'm trying to figure out a query that would look for dupes in two fields and then compare the date spans to ensure no dates over lap.

Ex.
RowId Contract_Id Product_Id Start_Date End_Date Price
1 1234 5678 1/1/2003 12/31/2003 153.23
2 1234 5678 1/1/2004 12/31/2004 150.45
3 1234 5678 6/15/2004 12/31/2005 151.47



Rows 2 and 3 would be flagged because they have the same product and contract Id's and their dates overlap.

Do you have any suggestions on a query that would spot all of these instances?

Thanks in advance
 
Back
Top Bottom