Home Forums SQL Server 7,2000 T-SQL Date Range between Start Date and EndDate RE: Date Range between Start Date and EndDate

  • It depends on the exact results you want.

    One way to do that is to join the two tables:

    select *

    from dbo.MyTable1 as T1

    inner join dbo.MyTable2 as T2

    on T2.DateColumn between T1.DateColumn1 and T1.DateColumn2;

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon