473,322 Members | 1,352 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Merge another table IF matching?

Hi i need help with a sql query. i have two tables Product and tblWebProduct, i need to merge the two tables together only copying the rows IF the stockcodes match (Product.StockCode & tblWebProducts.STOCK_CODE table). Products table will receive all the new data appending the new columns and row data.

thanks

example.
Product TBL
stockcode 001 : item jacket

tblWebProducts
stock_code 000 : price 12 : color blue
stock_code 001 : price 15 : color red

query output
Product TBL
stockcode 001 : item jacket : price 15 : color red

*bold = column/field

MS Access 2007
Sep 29 '07 #1
3 1243
nico5038
3,080 Expert 2GB
Open the graphical query editor and place both [Product TBL] and [tblWebProducts] table.

Now drag and drop the [stockcode 001] to the [stock_code 000] and see the JOIN-line appear.

Now double-click the needed fieldnames for the targettable.
To set the target table use the querytype "combobutton" where you select the "create table" (or append when already defined) option. Access will popup a form to enter the tablename. Finally save the query and run it by doubleclicking the tablename.

Clear ?

Nic;o)
Sep 29 '07 #2
Open the graphical query editor and place both [Product TBL] and [tblWebProducts] table.

Now drag and drop the [stockcode 001] to the [stock_code 000] and see the JOIN-line appear.

Now double-click the needed fieldnames for the targettable.
To set the target table use the querytype "combobutton" where you select the "create table" (or append when already defined) option. Access will popup a form to enter the tablename. Finally save the query and run it by doubleclicking the tablename.

Clear ?

Nic;o)
you lost me here...
To set the target table use the querytype "combobutton" where you select the "create table" (or append when already defined) option.
if i right-click Query Type is one of the options on the menu followed by
Select Query, Crosstab Query, Make Table Query, Update Query,Append Query, and Delete Query for the sub-menu
Sep 29 '07 #3
nico5038
3,080 Expert 2GB
You can use the "Make Table Query" fom the button, or from the Query menu.
Both give the same popup to specify the target table.

Nic;o)
Sep 29 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Luke Airig | last post by:
I have two xml files that I need to merge on their common field (date_time). The merged output file needs to have the date_time field and all fields from both of the two input files. I am using...
3
by: jaykchan | last post by:
One of the table that is in a merge replication somehow is missing an index. Strangely, only the table in one of the subscriber of the merge replication is missing the index; another subscriber and...
3
by: Andy Davis | last post by:
I have set up a mail merge document in Word 2003 which gets its data from my Access 2000 database. I want to set up a button on a form that: 1. runs the query to provide the dat for the merge...
7
by: Nitromuse | last post by:
Hello, I'm trying to merge two datsets which both have a common keyed column, and getting nowhere. Do I want to use the keyed column or not? I'm using the following and have tried all the...
1
by: Chris Ashley | last post by:
Hi there, If i have a dataset which has a datatable which has fields matching an existing SQL Server DB Table exactly, is there an easy way to merge all the records from the datatable into my...
4
by: Andreas Kasparek | last post by:
Hola! I'm preparing my master thesis about a XML Merge Tool implementation and was wondering if there is any open standard for XML diff regarding topics like: - is a diff result computed on...
16
by: UDBDBA | last post by:
Hi All: I need some clarification on a MERGE statement. The database is on V8 FP12 (AIX) 64bit. The source table is tableA. The target is a View "FACT" with UNION ALL because of the 512 Gig...
16
by: Sam Durai | last post by:
Hello, I need to merge a small table (of rows less than 100,sometimes even 0 rows) to a big table (of rows around 4 billion). I used the PK of the big table as merge key but merge does a table scan...
1
by: UDBDBA | last post by:
Hi, If someone can clarify this, it would be of great help! We have a merge, which is written *only* to update the target table. but the access plan shows branches with inserts and deletes on...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.