I am doing something wrong here...
I have a DB that I need to update with new data. The spreadsheet that I am using to update the database contains data that is already in the DB and data that is new. Here's what I have done, and it's not working...
I created an append query. Using the QBE, I added the spreadsheet table. I pulled in all of the fields from the spreadsheet. My unique field is SSN (social security number). I created a left join from the spreadsheet (Eligibility) to the table in the DB that I want to update (Eligible_Participants). When I run the query, it attempts to update ALL of my records, not just the new ones. (Unfortunately I don't know how many "new" records there are, but there probably isn't more than a couple hundred at the very most). Here is what the SQL code looks like, in case that helps. I need to figure this out! Every month I need to update this database with our new members. Help please! (I do not want to write over existing data in my DB in case someone has changed data for an existing member, like address, phone number, etc.)
INSERT INTO Eligible_Participants ( SSN, UniqueID, Alias, PropertyName, Plan, RelCode, FirstName, LastName, Address, City, State, Zip, Phone, BirthDate, Age, Lang, Email, TermDate )
SELECT DISTINCT Eligibility.SSN, Eligibility.UniqueID, Eligibility.Alias, Eligibility.PropertyName, Eligibility.Plan, Eligibility.RelCode, Eligibility.FirstName, Eligibility.LastName, Eligibility.Address, Eligibility.City, Eligibility.State, Eligibility.Zip, Eligibility.Phone, Eligibility.BirthDate, Eligibility.Age, Eligibility.Lang, Eligibility.Email, Eligibility.TermDate
FROM Eligibility LEFT JOIN Eligible_Participants ON Eligibility.SSN = Eligible_Participants.SSN
WHERE (((Eligibility.RelCode)="FM1" Or (Eligibility.RelCode)="MM1"));