>>>I am working on a SQL Select where result is parts/items used prior to a certain date but not used after this date. Here is my attempt which does not seem to work
>>>
>>>
>>>select * from part_file where part_pk in (select part_pk from part_used
>>>where used_date !> '20100101' and used_date < '20100101')
>>>
>>>
>>>How do I need to change the above SQL Select?
>>
>>
>>SELECT pf.*
>> FROM part_file pf ;
>> INNER JOIN part_used pu ON pu.part_pk = pf.park_used AND pu.used_date < '20100101'
>> WHERE pf.part_pk NOT IN (SELECT part_pk FROM park_used WHERE used_date > '20100101')
>>
>
>
>Thank you very much. I think you have a typo above where you typed 'pf.park_used' where it should be 'pf.part_pk'. Otherwise, no errors.
>I will test it against my database.
Ops! Sorry, but you spotted it pronto, so no problem...
----------------------------------
António Tavares Lopes