View Full Version : Query adding or deleting records


Dynarep
11-13-2001, 01:14 PM
I have an old database with 70,675 line items, customer names, months, info, info, info.
I have a new data base with 7,000 line items, customer names and customer codes.

When I join both tables at the customer name column, tell it to run a query to match names in table A and give me the customer code in table b (include all items from table a and include the code from table b), I get
70,656 for relationship 1
70,706 for relationship 2
70,659 for relationship 3

What I can do to correct this and not have to check each line item.

Thank you,

Pat Hartman
11-13-2001, 04:37 PM
You have "unmatched" key values in BOTH tables. You will need to run two "unmatched" queries to find all the bad data. Use the "unmatched" query wizard to build the queries. Choose table a first, then table b for one query. Then choose table b first, then table a for the second query.

Dynarep
11-14-2001, 10:00 AM
I ran the unmatched queries; A to B and then B to A. Now there is nothing in Table A that doesn't exist in Table B and viceversa.
Now, I still have 70,675 records going in from the customer database (Table A), but I have 70,706 when asked for the customer code from Table B in all three relationships. At least now it's consistant, but still not giving me what I need: 70,675 in, 70,675 out.

Pat Hartman
11-14-2001, 02:58 PM
Try a "find duplicates" query on each table.

Dynarep
11-14-2001, 03:29 PM
Table A has duplicates that need to be maintained (commissions). Table B does not have duplicates, but contains codes for the misshapen customer names; i,e.,
customer one
customer one.
customer_one
customerone
cust one
etc

I'm trying to get table B to provide the codes for Table A (with the duplicates) but I'm getting more than what I put in.
(Yeah it's a pain!)

Thanks, C-