Hi Edgar,
If I understand you correctly, you want to locate records in Table1 that do not have a matching record in Table2. Is this right?
If so, how about
SELECT * from Table1 Where ID_Field Not In ;
(Select Distinct ID_Field From Table2) ;
Into Cursor SomeCursor
HTH
Liam
>What would be the best way to do this?
>I have a table with ID’s that are good and bad, like:
>0102000
>0105015
>0105000
>……
>I need to go to another table and compare each ID starting with the first digit to the last and see if there is a match. That is, I begin my SCAN with 010200. Now in the good table I may find 0102, that would match my first 4 digits but I need to continue and see if there is a match for the next digit till the last (in this case of 010200)
>If I find a match, keep on scanning, if not apply it as Invalid and keep scanning.
>Any help would be appreciated.
Liam O'Hagan
MCP VFP Desktop Apps