Greetingsgive the following sample data, how can I make it so that I can reuse the same promocode as long as it does not overlap with an existing promo (that has same Promocode) start & end dates?Graciasdeclare @corelist table( RowNum int identity, [PromoCode] [varchar](255) NOT NULL, [StartDate] [datetime] NOT NULL, [EndDate] [datetime] NOT NULL )insert into @corelistSELECT 'SQLTeam Free Chocolate for all', '1/1/2012', '3/1/2012' select * from @corelistdeclare @list2 table( RowNum int identity, [PromoCode] [varchar](255) NOT NULL, [StartDate] [datetime] NOT NULL, [EndDate] [datetime] NOT NULL )insert into @list2SELECT 'SQLTeam Free Chocolate for all', '4/1/2012', '5/1/2012' insert into @corelist select t1.[PromoCode], t1.[StartDate], t1.[EndDate] from @list2 t1 left join @corelist t2 on t1.[PromoCode] = t2.[PromoCode] where (t1.[StartDate] not between t2.[StartDate] and t2.[EndDate] ) and (t1.[EndDate] not between t2.[StartDate] and t2.[EndDate] )select * from @corelist declare @list3 table( RowNum int identity, [PromoCode] [varchar](255) NOT NULL, [StartDate] [datetime] NOT NULL, [EndDate] [datetime] NOT NULL )insert into @list3SELECT 'SQLTeam Free Chocolate for all', '6/1/2012', '7/1/2012' insert into @corelist select t1.[PromoCode], t1.[StartDate], t1.[EndDate] from @list3 t1 left join @corelist t2 on t1.[PromoCode] = t2.[PromoCode] where (t1.[StartDate] not between t2.[StartDate] and t2.[EndDate] ) and (t1.[EndDate] not between t2.[StartDate] and t2.[EndDate] ) select * from @corelist
<><><><><><><><><><><><><><><><><>If you don't have the passion to help people, you have no passion