A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Comparing table data and adding differential information



 
 
Thread Tools Display Modes
  #1  
Old October 21st, 2009, 04:06 PM posted to microsoft.public.access.forms
Adam-Network Admin[_2_]
external usenet poster
 
Posts: 4
Default Comparing table data and adding differential information

Aappend queries allow you to add entire records to a table from a source.
Delete queries allow you to delete entire records.
Update queries allow you to update information on one table from information
on another.

How would I compare two tables and add just the records to one exist on the
other without adding every other record again. For example A has 400 records
and B has 399. I want to compare both tables to find the missing record and
add it to B to make B 400 records, not 799 records. How is this accomplished?

Thank You
Adam
  #2  
Old October 21st, 2009, 04:29 PM posted to microsoft.public.access.forms
NuBie via AccessMonster.com
external usenet poster
 
Posts: 67
Default Comparing table data and adding differential information

this query should work. customize your table/fiels names as appropriate.

INSERT INTO b
SELECT a.keyfield from a where keyfield not in (select keyfield from b);


Adam-Network Admin wrote:
Aappend queries allow you to add entire records to a table from a source.
Delete queries allow you to delete entire records.
Update queries allow you to update information on one table from information
on another.

How would I compare two tables and add just the records to one exist on the
other without adding every other record again. For example A has 400 records
and B has 399. I want to compare both tables to find the missing record and
add it to B to make B 400 records, not 799 records. How is this accomplished?

Thank You
Adam


--
Message posted via http://www.accessmonster.com

  #3  
Old October 21st, 2009, 06:32 PM posted to microsoft.public.access.forms
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default Comparing table data and adding differential information

If your TableB has a unique (i.e., no duplicates) row identifier, and if
TableA uses the same ID number, when Access tries to append records, it
refuses to append any record for which the ID already exists.

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or psuedocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

"Adam-Network Admin" wrote in
message ...
Aappend queries allow you to add entire records to a table from a source.
Delete queries allow you to delete entire records.
Update queries allow you to update information on one table from
information
on another.

How would I compare two tables and add just the records to one exist on
the
other without adding every other record again. For example A has 400
records
and B has 399. I want to compare both tables to find the missing record
and
add it to B to make B 400 records, not 799 records. How is this
accomplished?

Thank You
Adam



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:08 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.