Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi guys
i have following situation

.................query
SQL
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())))

but in this OR operator i want to get records where this condition is not true (means opposite of this ciondition)
as currently this will fetch records where this condition will be true .
any help ?
regards.
Posted
Updated 9-Oct-11 1:05am
v2

Try using NOT:
SQL
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())))
 
Share this answer
 
You can use the NOT operator[^]:

... OR NOT ( ... )
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900