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 » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Appending a table by adding only records who are not duplicates



 
 
Thread Tools Display Modes
  #1  
Old October 21st, 2009, 07:06 PM posted to microsoft.public.access.tablesdbdesign
Adam-Network Admin[_2_]
external usenet poster
 
Posts: 4
Default Appending a table by adding only records who are not duplicates

I am designing a database program for a Fantasy hockey league. table A gets
Players current stats from an excel spredsheet it is linked to. Table B is
to be updated with the current stats. Now updating existing records I have
no issues with. If a player is new or added, I need him to also be added to
table B. Here is the kicker, Table B has one more column for status (Free
Agent, or what team owns that player). I don't want this information to
change. I have tried to use an append query but that way not only adds the
new guy to table B, it adds every other guy again. A make table query would
be perfect, but it will eliminate that additional status column. Is there a
way to get an append query to do more of a differential append that will
append only those players that are currently not on Table B?

Thanks
Adam
  #2  
Old October 21st, 2009, 07:12 PM posted to microsoft.public.access.tablesdbdesign
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default Appending a table by adding only records who are not duplicates

Isn't this essentially the same as your other post? Why post the same issue
in two different newsgroups?

This causes you more work, since you have to look in all the places you
posted to see if you have any response.

This causes us (volunteers) more work, since we don't know that someone else
already addressed your issue in another newsgroup.

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 ...
I am designing a database program for a Fantasy hockey league. table A
gets
Players current stats from an excel spredsheet it is linked to. Table B
is
to be updated with the current stats. Now updating existing records I
have
no issues with. If a player is new or added, I need him to also be added
to
table B. Here is the kicker, Table B has one more column for status (Free
Agent, or what team owns that player). I don't want this information to
change. I have tried to use an append query but that way not only adds
the
new guy to table B, it adds every other guy again. A make table query
would
be perfect, but it will eliminate that additional status column. Is there
a
way to get an append query to do more of a differential append that will
append only those players that are currently not on Table B?

Thanks
Adam



  #3  
Old October 21st, 2009, 07:51 PM posted to microsoft.public.access.tablesdbdesign
Daryl S[_2_]
external usenet poster
 
Posts: 881
Default Appending a table by adding only records who are not duplicates

If you have a key value (PlayerID, or PlayerName, etc.) that is common to
both tables, then you have two options. If you make this key value the
primary key to the table, then only 'new' players will be added - the others
will fail. The other option is to update your append query so that there is
a criteria on the identifying value like the following (assuming PlayerID is
the identifying field in both tables):

Not in (select [PlayerID] from [TableB])

--
Daryl S


"Adam-Network Admin" wrote:

I am designing a database program for a Fantasy hockey league. table A gets
Players current stats from an excel spredsheet it is linked to. Table B is
to be updated with the current stats. Now updating existing records I have
no issues with. If a player is new or added, I need him to also be added to
table B. Here is the kicker, Table B has one more column for status (Free
Agent, or what team owns that player). I don't want this information to
change. I have tried to use an append query but that way not only adds the
new guy to table B, it adds every other guy again. A make table query would
be perfect, but it will eliminate that additional status column. Is there a
way to get an append query to do more of a differential append that will
append only those players that are currently not on Table B?

Thanks
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 04:49 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.