Update Several Records with separate table data

I have two tables.  One has all fields complete.  The other has some
complete records, but most only have one field completed.  I want to
input the complete records to the incomplete table, merging any
records that would be duplicated.

0
mba
3/21/2007 4:42:29 AM
access.queries 6343 articles. 1 followers. Follow

1 Replies
773 Views

Similar Articles

[PageSpeed] 8

I forgot to mention this in my first post.

Why are you duplicating data in your database?  The goal of a well designed 
database is to only store the same piece of information once.

Dale
-- 
Email address is not valid.
Please reply to newsgroup only.


"Dale Fye" wrote:

> In Access (am unsure whether A2007 supports this), you can do this as a 
> single step, don't know about the current versions of SQL Server and Oracle.  
> Some people call this an UPSERT query, because you are doing both an update 
> and an insert at the same time.  It looks something like:
> 
> UPDATE TableB AS b 
> RIGHT JOIN TableA AS a 
> ON b.ID = a.ID 
> SET b.Field1 = [a].[Field1], b.Field2 = [a].[Field2], b.Field3 = [a].[Field3];
> 
> This assumes that TableA is the more complete of the two tables.  It takes 
> all of the records from table A, and either updates, or inserts Field1, 
> Field2, and Field3 into TableB.  If a record with the same ID value already 
> exists in TableB then it will update the values of those fields.  If no 
> record exists in TableB that matches the ID value in TableA, then a record 
> will be inserted.
> 
> In other systems, and for clarity, you might want to consider writing this 
> as two queries (an Update and an Insert).
> 
> HTH
> Dale
> 
> -- 
> Email address is not valid.
> Please reply to newsgroup only.
> 
> 
> "mba.bcis@gmail.com" wrote:
> 
> > I have two tables.  One has all fields complete.  The other has some
> > complete records, but most only have one field completed.  I want to
> > input the complete records to the incomplete table, merging any
> > records that would be duplicated.
> > 
> > 
0
Utf
3/21/2007 12:15:38 PM
Reply:

Similar Artilces:

Office X 10.1.6 Update: Fonts missing?
> This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --B_3182711903_8674241 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit After updating to 10.1.6, some fonts are missing (KidPrint, Lucida handwriting, etc.) Any ideas? --B_3182711903_8674241 Content-type: text/html; charset="US-ASCII" Content-transfer-encoding: quoted-printable <HTML> <HEAD> <TITLE>Office X 10.1.6 Update: Fonts missing?</TITLE> </HEAD> <BODY> <FON...

Updating PO Line Qtys should not remove existing AA with 100% Assi
Assuming AA is setup and you have at least 1 Dimension linked to an Account, and that Dimension has a Dimension Code attached. 1. Go into PO Entry 2. Enter a line item 3. Go into Purchasing Item Detail entry and make sure your Inventory Account is an account linked to your AA Class and therefore Dimension. 4. Enter AA information against this account on the PO - using the default of 100% Assignment. 5. Return back to the PO Entry window. 6. Change the Qty on the PO Line to be 1 greater (or less). Press tab to move off the field. Actual Result: The already assigned AA data for that line...

Advanced find
In advance find a customer wishes to know how many of each product an account has ordered. The Order lines, Quote Lines, Invoice Lines are not available as output entities. Therefore no reporting on advanced find is avaiable. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message...

merging into Word with filtered data
Hello, I'm trying to do a merge in Word using data from Excel. However, I don't want to merge using data from the whole worksheet, but just filtered data (all people from London - place is one of the fields in the worksheet. I have no idea how I might do this. Any help gratefully received. I believe you can accomplish this from Word by using "Query Options" and selecting to merge only those records you're seeking. HTH PC "Italian Pete" <ItalianPete@discussions.microsoft.com> wrote in message news:3E62FCDC-42EC-48DB-92AC-857B224F085F@microsoft.c...

Data Loss in Publisher
Hi I run a W2k network in a school. I have Office Group Policies in place forcing the default save location for Publisher documents (Office XP version) to the pupil's home folders. All my PCs are identical (ghost images). Pupils have roaming profiles (some mandatory). Some users save work in Publisher and the next time they log on to the network and open the saved file, it's contents have gone! There is nothing exceptional about the affected users' user accounts and they have a mixture of mandatory and roaming profiles. Has anyone come across this problem before? Than...

merging 3 spreadsheets into one based upon a single common data field
OK I hope you guys can help me out. Here is the scenario. I have 3 spreadsheets. The main spreadsheet I working with has 500 lines with a unique number string. The next two spreadsheets have about 12000 lines but also contain the same unique string as the first spreadsheet. I want to search the 2nd and 3rd spreadsheet using the first spreadsheets unique id number and then take the information from the 2nd and 3rd spreadsheet and then merge it into the first. Does that make since? Any help would be great. -- xchosen --------------------------------------------------------------------...

How to combine two identically structured tables to query them
Hi, I am sure there is a way that you can have a query that effectively takes two separate tables that have the identical column layout and add them together and then perofrm a query on the combined set of data. I just can't remember how to do it. My reason for need in this is that I have a table called "SellerNumbers" that has 4 million rows of data in it and what I want to do to improve performance is archive the oldest 2 years worth of data to an identical table called "SellerNumbersArchive", however the users want to be able to occasionaly run quer...

Any way to clear out stock pricing data before or after going to Quicken?
With all the discussion a few months ago about taking control of our own data, I had gone through the steps to look at my Money file as an Access DB, and found that of my 80MB, more than half was daily stock prices. Thats not something I really want to convert and maintain. I can't imagine that its really needed, since transactions have their own price info. Is there any way to get rid of it in Money, in Quicken, or other? Thanks In Money Plus: Portfolio > Other Tasks > More > Clear historical quotes The process may be different in earlier versions. "JDelMar&q...

Pivot table #11
I asked this yesterday but I am having difficulty getting to my original post. Page 1 of this news group keeps brining me to feb 17th.... anyways this is what i asked yesterday: Is there a way I can set up a pivot table with sub categories? i.e. Type of Contact is my heading and under it I have 4 categories (phone, walk-in, etc...) Thanks. A. I got this reply: If you add Type of Contact to the row area, you should see all of the categories. Can you describe the fields in your data table, and how you'd like them to appear in the pivot table? My answer to this is: I would like...

moving large amounts of data from one db to another
I have a table that has millions of rows of data in it, which then references another table with millions of referenced (matching by foreign key constraints)... I need to move this data from database A to a new database B, is there any way to do this and preserve the identity columns and their referential integrity?) Thanks! You can't have integrated RI across databases so that part is out. But you can certainly insert and keep the identities. Take a look at SET IDENTITY INSERT in BOL. -- Andrew J. Kelly SQL MVP Solid Quality Mentors "Smokey Grindel"...

record sheet row order, then restore to that point
There is the ability to undo a sort so I suspect the information I want is somewhere. Is there a way to take a "snap shot" of a sheet's current row order, and then restore that row order at any point in the future? During sheet processing, rows will not be added, but data in any cell may change. The only other way I can think of doing this, is to record the order of some "signature" column and then use it to re-write the processed sheet to a scratch sheet. Thank you Add a new column before you do the 1st sort with number 1 to last row. then sor tby ...

Pulling data from multiple worksheets
I have one worksheet with a listing of client numbers and names. I would like to be able to type in a client number on another worksheet and have the client name automatically populate. Look at the Vlookup function or the combination of Index / Match. Vlookup will be a little more straight forward for a first timer but Index / Match is generally speaking a more flexible and less error prone solution. -- HTH... Jim Thomlinson "parthur" wrote: > I have one worksheet with a listing of client numbers and names. I would > like to be able to type in a clie...

Connecting tables
Is there any way to connect tables in Publisher similiar to the way you can connect text frames for overfill. kpappano wrote: > Is there any way to connect tables in Publisher similiar to the way you can > connect text frames for overfill. Nope. -- Ed Bennett - MVP Microsoft Publisher http://ed.mvps.org Is there any other way I can do it? Any suggestions? "Ed Bennett" wrote: > kpappano wrote: > > Is there any way to connect tables in Publisher similiar to the way you can > > connect text frames for overfill. > > Nope. > > -- > E...

Simple update Query
Hi, I'm sure I've done this in the past but can't figure how. I have 2 tables "A" and "B" both with the following fields Town; Council I want to update Table "A"'s Council field with the Council information in table "B" Could someone please give me the SQL code to do this. Thanks in advance UPDATE TableA INNER JOIN TableB ON TableA.Town = TableB.Town SET TableA.Council = TableB.Council. IF you can only do this using design view -- Open a new query -- Select the two tables -- Set up a join by dragging from town to town -- add the Cou...

summarise data
I have data on a sheet looking like this 5/5/2004 5/5/2004 7/5/2004 7/5/2004 7/5/2004 7/5/2004 8/5/2004 9/5/2004 9/5/2004 9/5/2004 and I want to summarise this into different cells so that it look like 5/5/2004 7/5/2004 8/5/2004 9/5/2004 i.e. I want to list individual occurances of repeating dates o numbers. Any help would be much appreciated -- Message posted from http://www.ExcelForum.com Sounds like a job or a Pivot Table perhaps? http://www.ozgrid.com/Excel/excel-pivot-tables.htm ** Posted via: http://www.ozgrid.com Excel Templates, Training, Add-ins & Business Software Galore...

creating a program that uses data from a sensor....
Hello, I want to create an MFC program that uses parameter values passed to it from a meter (specifically the resistance in ohms of resisters in an electronic circuit). What are the hardware components that would be needed? And what MFC class(es) would I use to accomplish this? Thanks, RABMissouri2006 On 21 Oct 2006 08:10:50 -0700, "RAB" <rabmissouri@yahoo.com> wrote: >Hello, > >I want to create an MFC program that uses parameter values passed to it >from a meter (specifically the resistance in ohms of resisters in an >electronic circuit). What are the ha...

Data archive with GP Manufacturing
Has anyone had experience with any data archive with GP Manufacturing. The product from Professional Advantage does not support Manufacturing archive, at least not in the documentation. Don't have an answer for you but we will be doing the same in the next week or so. Will report back when done. "DavidInterDyn" wrote: > Has anyone had experience with any data archive with GP Manufacturing. The > product from Professional Advantage does not support Manufacturing archive, > at least not in the documentation. ...

Transfering Outlook Data to a New PC
I've just built a new PC. Currently it has nothing on it other than Windows. When I install Outlook 2003 I'll need to transfer the data from another PC onto it, including all folders, emails and attachments in them and calendar data. What's the easiest and most effective way to do this? Find the PST file and copy it to the new machine and into the appropriate directory, what? Thanks. Copy the pst(s) to the new PC There isnt an appropriate Folder, there is a default folder created when Outlook is installed. http://www.howto-outlook.com/howto/backupandrestore.htm "Marts&q...

Drag and Drop Records
Hi, I need to create a relationship between two sets of data, Purchase Order and Production Schedule Order. I've reviewed many different ways to get this done but always come back to manual intevention due to the two sets of data being different. So, what I would like to do is create a form with two sub forms, both in datasheet view. The user drags a record from one datasheet to the other, which then updates the two fields in the table being dropped on. Just wondered, is this possible? and if so got any pointers on how to do it... Thanx in advance Marcus ...

Locking of entered data
I haev a form that currently allows you to enter new records and edit existing records. My key field is based on a number entered by the user from another system. Once the number is entered I do not want the user to be able to type over that number but still be aloud to add a new record. I tried the AllowAdditions and AllowEdits in the properties but if I set them to Yes AllowAdditions and No AllowEdits then nothing can be changed. I want them to be able to edit everything but the one field containing the number. Ideas? Glenna, The code I provided would go in the two places that I...

how can I split one cell's data into two cells?
I am using Excel as a database, and have a column with cells with a person's name (text) in it...e.g., John Smith. NOW, after the fact, I wish to have a column with just John in it, and another column with just Smith...but I have NO idea how to do this! Help would be appreciated. Thank you. Please refrain from multiposting, you have answers in one of the 4! newsgroups you posted the same question in. Multiposting is frowned upon and even the MS web interface states so -- Regards, Peo Sjoblom Excel 95 - Excel 2007 Northwest Excel Solutions www.nwexcelsolutions.com "It ...

duplicate records 10-26-05
Hi, How can i make a field as primary? For Example: in the account record, can i make the account name as Priamry. How can we control duplicate records in CRM? like cases, contacts, accounts etc. Do we need any customization? What tools can we use to accomplish this? Thanks Dev In CRM 1.2 you can not change the primary field and there is no duplicate checking. There are 3rd party tools that can do searches for duplicates and let you merge them, but nothing really effective at preventing duplicate records. For CRM 3.0 there is an example in the SDK of how to create a custom duplicat...

Losing data in flashdrive
I am experiencing in losing data in flashdrives. It seems that when files are copied onto flashdrive, I should wait for a while before removing flashdrives from USB port. Does anybody know how long should I wait before unplugging flashdrives. Jorge Are you using the Safely Remove Hardware icon in the notification area? If so, it should tell you when you can remove the drive. ....Alan -- Alan Edwards, MS MVP Windows - Internet Explorer http://dts-l.com/index.htm On Mon, 1 Mar 2010 17:29:25 -0700, in microsoft.public.windowsxp.general, "Jorge Cervantes"...

What table....
What table does the "More addresses" section use? The "More addresses" is found on the side when you are filling out a contact. CustomerAddress Base Dave "GDaxon" <GDaxon@discussions.microsoft.com> wrote in message news:BA8C768F-3664-4FAF-9CBA-6F6F28C8FD64@microsoft.com... > What table does the "More addresses" section use? The "More addresses" is > found on the side when you are filling out a contact. Dear, Check Customeraddressbase. I hope this will help u. Thanks, MVP- CRM/.Net mscrmexpert@gmail.com "GDaxon&qu...

Size of Data input mask
How can I change the size of an Excel Input Mask? Do you mean you want to limit (or even check) the number of characters in a cell when the user is entering data? If yes, take a look at Data|Validation|Settings tab|Allow Text Length If no, then you may want to clarify your question more. Juerg Rohner wrote: > > How can I change the size of an Excel Input Mask? -- Dave Peterson ec35720@msn.com ...