# Database Discussions > Microsoft SQL Server 2005 >  Comparing Date Spans

## frankd

I need to write a query that would compare 2 pairs of dates.A start and end date for both rows. The second start date needs to be >= to the first end date.  That is, there should be no gaps between the second start date and first end date.

ex: Good Scenario

First Start:  10/01/2006      First End:  12/31/2007
Second Start: 11/30/2007   Second End: 01/31/2008

ex: Bad Scenario

First Start:  10/01/2006      First End:  12/31/2007
Second Start:  02/01/2008  Second End:  04/30/2008

----------


## rmiao

Can you post table schema?

----------

