Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need help comparing two tables
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00386341
Message ID:
00386361
Views:
16
Build UDF that generates a string from all the fields i.e:
****
function mifuncion
private cadena
cadena=""
cadena=cadena+iif(myfield01,"1","0")
cadena=cadena+iif(myfield02,"1","0")
cadena=cadena+iif(myfield03,"1","0")
cadena=cadena+iif(myfield04,"1","0")
cadena=cadena+iif(myfield05,"1","0")
....
cadena=cadena+iif(myfield24,"1","0")
return cadena
******

index your table2 like this:
index on mifuncion() to table2
after that, edit a prg with this:
*****
use table1 in 0
use table2 index table2 in 0
select table1
go top
k=0
micadena=""
do while !eof()
micadena=mifuncion()
select table2
seek micadena
if found()
k=k+1
endif
select table1
skip
enddo
wait wind "There are "+str(k)+" Coincidences"

********
Hope this help.
Previous
Reply
Map
View

Click here to load this message in the networking platform