Need help with append querry.

F

FatMan

Hi All
I am trying to do an append query but cannot understand why records are
being rejected. The message says that 149 records were not added due to key
violations. I had expected 144 records to be rejected but can not figure out
what the other 5 records are. Can anyone help?

The back ground is this....I have a table that is an export out of an HR
database (I believe a software package called PeopleSoft) that has duplicate
records for some employees. They keep one record for their "home base" and
one for what "assignment" they are on. There is nothing I can do about this,
it is what it is. What I need to do is append the data exported out of the
HR database to a "contacts" table and then update the "notes" field in the
contacts for those records duplicated.

I know there are 288 duplicate records in the record set to be appended to
the "contacts" table and therefore thought 144 records would be rejected to
key violations. What I cannot understand is why/how the other 5 records are
rejected. I have tried an "unmatched" query between the two tables but this
has resulted in now records being shown.

Can anyone please offer some help? All advice is greatly appreciated.

Thanks,
FatMan
 
J

Jeff L

It sounds like some records have more than 1 duplicate. To verify, you
could run this query on the data you are trying to append.
Select ID, Count(ID)
From YourTableTame
Group By ID
Having Count(ID) > 2

This would give you all records that have more that one duplicate.

Hope that helps!
 
F

FatMan

Jeff:
Thanks for the words of wisdom. Stupid me....I took the HR department's
word and believed there to be a max of two records for any one employee.

Your help is greatly appreciated.

Thanks,
FatMan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top