Solved

Access 2003 Select Distinct in Append Query

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

749 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