INNER JOIN T_Line L ON L.FK_Line_Master = TPLA.FK_Line_Master OR (L.ValidFrom <= TPLA.ValidFrom AND TPLA.ValidUntil<= ISNULL(L.ValidUntil, DATEADD(year,100, GETDATE())))
INNER JOIN T_Line L ON L.FK_Line_Master = TPLA.FK_Line_Master OR NOT (L.ValidFrom <= TPLA.ValidFrom AND TPLA.ValidUntil<= ISNULL(L.ValidUntil, DATEADD(year,100, GETDATE())))
... OR NOT ( ... )
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)