I have a table A that has a startDate and an end dateDate as 2 datetime columns besides some more other columns. I have another table B that has one datetime column call it
If you need to optimize try to run this query in the Query Analyzer.