Solved

Access 2003 Select Distinct in Append Query

Posted on 2004-08-16
1
551 Views
Last Modified: 2012-08-13
I am appending table 'A' to table 'B'. Both tables have a very simular structure.  The group of fields last,first & init have a unique value.  If this unique group is not present in table 'B' these fields, along with several other non-unique fields,  should be added to table 'B'.

My question is how do I limit Select Distinct so the other fields which are part of the same record are also updated?

Example:

Insert into Master (Last,first... )
Select Distinct Daily1.last,Daily1.first   ...
                     [plus other fields (address,city,state) ]
From Daily1

Thanks,

David
0
Comment
Question by:DavidDF1913
1 Comment
 
LVL 9

Accepted Solution

by:
samopal earned 250 total points
ID: 11813308
Insert into Master (Last,first... )
Select Distinct Daily1.last,Daily1.first   ...
                     [plus other fields (address,city,state) ]
From Daily1
Where NOT EXISTS (
  Select * From Master Where Master.Last=Daily1.Last and Master.First=Daily1.First and ...
)

D'Al
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question