Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SOS! Think you can help me?
Message
 
 
To
18/06/1999 08:38:35
Chuck Tripi
University of Wisconsin - Milwaukee
Milwaukee, Wisconsin, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00230966
Message ID:
00231390
Views:
17
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):
* find duplicates between new pos and histoical pos 
* Chuck: you would put all fields in the query below

SELECT workpo.* ;
  FROM workpo, histpo ;
  WHERE workpo.ponum = histpo.ponum AND ;
        workpo.varname = histpo.varname ;
  INTO CURSOR tab2 NOFILTER

* no get any new po that is either new or changed (ie not in the duplicate table)
* this assumes each ponum is unique

SELECT workpo.* ;
  FROM workpo ;
  WHERE workpo.ponum NOT IN (select ponum from tab2) ;
  INTO cursor cChanges NOFILTER

* tab2 has duplicates
* cChanges has pos that are new or have a change
 
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)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform