Solved

Access 2003 Select Distinct in Append Query

Posted on 2004-08-16
1
530 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

746 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now