Try this out. Note that I used smalldatetime for StartRejection as some readers may not be on SQL 2008+.
DECLARE @EmailRejection TABLE (EmailName varchar(150), StartRejection smalldatetime, Duration smallint, IsIndefinate bit)
DECLARE @Today smalldatetime, @Duration smallint
SET @Today = CONVERT(smalldatetime, CONVERT(varchar, GETDATE(),112))
SET @Duration = 5
INSERT INTO @EmailRejection(EmailName, StartRejection, Duration, IsIndefinate) VALUES('[email protected]', @Today-3, @Duration, 0)
INSERT INTO @EmailRejection(EmailName, StartRejection, Duration, IsIndefinate) VALUES('[email protected]', @Today-4, @Duration, 0)
INSERT INTO @EmailRejection(EmailName, StartRejection, Duration, IsIndefinate) VALUES('[email protected]', @Today-5, @Duration, 0)
INSERT INTO @EmailRejection(EmailName, StartRejection, Duration, IsIndefinate) VALUES('[email protected]', @Today-6, @Duration, 0)
INSERT INTO @EmailRejection(EmailName, StartRejection, Duration, IsIndefinate) VALUES('[email protected]', @Today-10, @Duration, 1)
SELECT * FROM @EmailRejection
WHERE (IsIndefinate = 1) OR (IsIndefinate = 0 AND StartRejection > DATEADD(dd, 0-Duration, GETDATE()))
IsIndefinate (sic should be IsIndefinite)
/spellingpolice