Searching equal records

CMontoro

Registered User.
Local time
Yesterday, 16:11
Joined
Mar 26, 2005
Messages
21
I have two tables named PERSONAL and CUSTOMER
PERSONAL table has fields : ID_PER, P_LASTNAME, (key = ID_PER)
CUSTOMER table has fields : ID_CUS, C_LASTNAME, (key = ID_CUS)

I need a process to review each LASTNAME in PERSONAL table and to search if there is a equal LASTNAME in CUSTOMER.

How can I identify equal records and to save them in another table named EQUALS ?

Thanks in advance
Carlos
 
Create a new query. Add CUSTOMER and PERSONAL. Link P_LastName to C_Lastname (and any other fields that you want to be equal).

Bring down whatever fields you want in the new table.

Change your query to a make table query, and run it.
 
Hi EJSTEFL
Thanks for you answer, but I need to review each record. Something like that:

do while not eof()
compare PERSONAL_lastname with CUSTOMER_lastname
if p_lastname = c_lastname then
save p_lastname in Table EQUALS
endif
skip
enddo

Thanks again
Carlos
 
Not sure I understand... the query I posted will put each record that LastName in a new table if it exists in both tables. Is this not what you need to do?
 

Users who are viewing this thread

Back
Top Bottom