Okay.
So you have a historical set of POs and you have POs that have been done today. You then want to compare your new POs your historical POs to see if anyone has made changes.
Here is some rough code (a basis to start your own):
SELECT workpo.* ;
FROM workpo, histpo ;
WHERE workpo.ponum = histpo.ponum AND ;
workpo.varname = histpo.varname ;
INTO CURSOR tab2 NOFILTER
SELECT workpo.* ;
FROM workpo ;
WHERE workpo.ponum NOT IN (select ponum from tab2) ;
INTO cursor cChanges NOFILTER
I hope this is close to what you want. I am not sure what "This is only for if there is same number of record count on both table" is for.
Give another stab at your coding.
>two tables
>one table receives data every day (WORKPO)
>
>one table stores data for one fiscal year (HISTPO)
>
>WORKPO would have the most updated data
>
>I need to keep track (to produce reports) on what happen
>
>I take a PO # and pull it out of WORKPO into cursor TEMPCUR (so there is all of same PO #)
>
>I compare the other 7 fields with TEMPCUR and HISTPO (in the coding, I pull out the matching PO # out of HISTPO into HISTTEMP so I can mess around with it -via deleting records- without mess up the "live" HISTPO, same for the cursor TEMPCUR)
>
>If all matches, I append data from TEMPCUR to TAB2 ("No Action" table)
>
>If any data in any field did not match, I append data from TEMPCUR to TAB3 ("Changes" table)
>
>This is only for if there is same number of record count on both table (TEMPCUR and HISTPO)