>select * from part_file where part_pk in (select part_pk from part_used >where used_date !> '20100101' and used_date < '20100101') >>
select * from dbo.part_file p where not exists (select 1 from dbo.part_used pu where used_date >='20100101' and pu.part_pk = p.part_pk)Select all parts which were not used after 01-01-2010. (This may return parts which were not used at all)
select * from dbo.part_file p where not exists (select 1 from dbo.part_used pu where used_date >='20100101' and pu.part_pk = p.part_pk) and exists (select 1 from dbo.part_used pu where used_date <'20100101' and pu.part_pk = p.part_pk)