Q :: Request help writing a SQL.Query that validates a given date against 'black out' dates which consist of a date(PublicationDate) and anoffset(MDBP). Such that PublicationDate of Nov 26, Offset of 2 means that no dates between nov24 and 28 are permitted (PubDate ±MDBP) CREATE TABLE [WinningBids] ( [TransactionID] [int] IDENTITY (1, 1) NOT NULL , [FinalPrice] [int] NULL , [TransactionDate] [datetime] NULL , [PublicationDate] [datetime] NULL , [AdNumber] [varchar] (20) NULL , [CampaignID] [int] NULL )CREATE TABLE [DatesRequested] ( [ReqID] [Int] IDENTITY(1,1) NOT NULL, [ReqDate] [DATETIME] NOT NULL ):: SomeData WinningBids01,180,11/10/2005,11/16/2005,2,A0034,28,702,200,11/20/2005,11/26/2005,2,00022,45,803,210,11/20/2005,11/22/2005,2,AA004,48,8:: graphicaly ; three campaigns have 'hit on 16,22,26I want to if date(n) is valid against this data.14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30-- -- 03 -- -- -- -- 01 -- -- -- -- 02 -- --Expected Results ::of the following example target dates, i'd like the query return something like the following. Nov 17 = 0 rec returned Nov 19 = return ReqID if exist Nov 20,24,28 = 0 rec returned Nov 29 = return ReqID if exist
:: NOTESMDBP won't always be two.any insight or helpful reading pointers would be graciously appreciated.V/R -- MickeMicke