Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Comparing one table to another
Message
From
26/11/2002 13:41:19
 
 
To
26/11/2002 13:31:48
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00727145
Message ID:
00727181
Views:
29
Lets say you have two table Table1 and Table2
you can take table1 record by record and Scatter Name oT1Flds
oT1Flds will have a property for every field in the table
Do the same with Table2 and now you can do a record to record match based on field to field

lnFlds = ADBF(laFlds,"Table1")
Select Table1
Scan
Scatter Name oT1Flds
lcKey = oT1Flds.field1 && field1 = key fld (or whatever the key field(s) should be)
If Seek(lcKey,"Table1","Index1")
Select Table2
Scatter Name oT2Flds
For xx = 1 To lnFlds
*** compare oT1Flds.fieldname with oT2Flds.fieldsname (fieldname = laFlds[xx,1])
EndFor
Select Table1
EndIf
EndScan
-------------------------

This is the "down and dirty" version. Let me know if this helps or if you want to bounce it back and forth some more.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform