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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|