PC Review


Reply
Thread Tools Rate Thread

Appending a table by adding only records who are not duplicates

 
 
Adam-Network Admin
Guest
Posts: n/a
 
      21st Oct 2009
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
 
Reply With Quote
 
 
 
 
Jeff Boyce
Guest
Posts: n/a
 
      21st Oct 2009
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" <(E-Mail Removed)> wrote in
message news:4A46FE96-2B01-4368-9AEF-(E-Mail Removed)...
>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



 
Reply With Quote
 
Daryl S
Guest
Posts: n/a
 
      21st Oct 2009
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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding Records to a table but preventing duplicates + other tests GLT Microsoft Access Queries 7 1st Feb 2010 06:25 AM
HELP!!!! Upload table records deletes existing records instead of appending. rbagley@kodersolutions.com Microsoft Dot NET Compact Framework 1 2nd Feb 2007 09:51 AM
HELP!!!! Upload table records deletes existing records instead of appending. rbagley@kodersolutions.com Microsoft Dot NET Compact Framework 0 2nd Feb 2007 02:16 AM
appending records without creating duplicates in a non-indexed table Applebaum Microsoft Access Queries 1 28th Apr 2004 11:14 PM
Appending data to table & avoiding duplicates mikebres Microsoft Access Form Coding 4 10th Feb 2004 03:43 AM


Features
 

Advertising
 

Newsgroups
 


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