I will explain as best I can for what we need to program with VFP 6.0. Since I can explain best if I use DO CASE so we can see the point better with little "english".
There are three tables (all in one DBC):
WORKPO.dbf (and field "po" is CDXed) "working table"
HISTPO.dbf (and field "po" is CDXed) "history table"
DELEPO.dbf (just in case we need to look back...) "deleted data"
What happens is we import data into WORKPO.dbf and then see if there is a match in HISTPO.dbf. It goes like this:
SEEK or SCAN or LOCATE for WORKPO.po = HISTPPO.po
DO CASE
IF FOUND()
SELECT WORKPO
COUNT FOR how many "po" TO po1
SELECT HISTPO
COUNT FOR how many "po" TO po2
DO CASE
CASE po1 <> po2
remove all matched "po" to DELEPO
APPEND new matched "po" into HISTPO
CASE po1 = po1 AND there are only one "po" in both tables
check all the fields of that "po"
IF all fields matched
leave it alone and EXIT/LOOP to the next record in WORKPO
ELSE
remove matched "po" from HISTPO to DELEPO
APPEND new matched "po" (new updated data)
ENDIF
CASE po1 = po2 AND there are more than one "po" on both tables
(or OTHERWISE)
******************************************
** this is where I need to figure out!! **
******************************************
say suppose there is 4 "po" on both tables, I need to check
record by record, and once a record matches (all fields), I need to MARK that record so I don't check that same record again with the next
matching "po", did you follow this?
Chuck
Today is tomorrow's yesterday.