?
Solved

MS Access 2010 Query to update one table from another

Posted on 2015-02-04
5
Medium Priority
?
219 Views
Last Modified: 2015-02-04
Hi ,

     I was looking for the query to update a few colums (col1,col2,col3)  in TableA   from an identical table TableB  ( where the condition TableA.PrimKey = TableB.PrimKey)

   Can you please help
0
Comment
Question by:Sam OZ
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 18

Assisted Solution

by:Simon
Simon earned 300 total points
ID: 40588618
update tableA
set A.col1=B.col1, A.col2=B.col2
from tableA A inner join tableB B on A.Primkey=B.Primkey
0
 

Author Comment

by:Sam OZ
ID: 40588652
Thanks Simon . But is this tested in MS Access  ? I am getting an error   "Syntax error  Missing operator
 in query expression  from tableA  as  A inner join tableB as B on A.Primkey=B.Primkey
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 1400 total points
ID: 40588653
update tableA
inner join tableB On A.Primkey=B.Primkey
set A.col1=B.col1, A.col2=B.col2
0
 
LVL 18

Expert Comment

by:Simon
ID: 40588791
Sorry, not tested on Access, and written with the wrong flavour of SQL in mind. Apologies
0
 
LVL 38

Assisted Solution

by:PatHartman
PatHartman earned 300 total points
ID: 40588795
When you don't know the correct syntax, try using the QBE to build the query.  In this case:
1. Add both tables to the grid.
2. Draw a join line to connect the two tables on the appropriate columns.
3. Select the columns from the table you want to update
4. Change the query type to Update - Access adds a new row to the grid.
5. in the update To row, type the tablename.columnname of the source data.
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question