This situation requires some explanation.
I am trying to set up an importing routine for syncing contacts in an Access 2007 database with Outlook 2007, however I don't want to link the databases - I want to import from Outlook to Access.
I am importing all contacts using a .CSV file, into a new table called "Outlook Contacts". I then use an append query to add all records from Outlook Contacts to my main Contact table. This however produces duplicates, because I repeat the process once a week (to add in newly created contacts from Outlook). So in a given import, only 5 of the 100 imported contacts I want to actually retain.
Next I use a Find Duplicates query to find any duplicates in the Contact table with the same First and Last names (yes, I know it is possible to have 2 John Smiths, but this is a small business, and if this exception does occur I'll deal with it on a case to case basis).
What I want to do is create a Delete Query (Using the duplicate query as a source) that deletes all the duplicate records but one; however I want to retain the record that has the most fields with non-null values. My question is how would I go about counting non-null fields for a certain record, and how would I compare these in a query to designate the proper record to retain?
Thanks in advance.
I am trying to set up an importing routine for syncing contacts in an Access 2007 database with Outlook 2007, however I don't want to link the databases - I want to import from Outlook to Access.
I am importing all contacts using a .CSV file, into a new table called "Outlook Contacts". I then use an append query to add all records from Outlook Contacts to my main Contact table. This however produces duplicates, because I repeat the process once a week (to add in newly created contacts from Outlook). So in a given import, only 5 of the 100 imported contacts I want to actually retain.
Next I use a Find Duplicates query to find any duplicates in the Contact table with the same First and Last names (yes, I know it is possible to have 2 John Smiths, but this is a small business, and if this exception does occur I'll deal with it on a case to case basis).
What I want to do is create a Delete Query (Using the duplicate query as a source) that deletes all the duplicate records but one; however I want to retain the record that has the most fields with non-null values. My question is how would I go about counting non-null fields for a certain record, and how would I compare these in a query to designate the proper record to retain?
Thanks in advance.