473,395 Members | 1,581 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,395 software developers and data experts.

Update queries using more than one table

I am an Access 2010 novice who is trying to update one table with information from another i.e. when table 1 col 1 = table 2 col 1, update table 1 col 2 with table 2 col 2, but keep getting syntax errors when using the following code. Can anyone help point out where I am going wrong.

Expand|Select|Wrap|Line Numbers
  1. UPDATE TrafficApr11toDate 
  2. SET [Originating Country] = (SELECT OriginatingCountry.[Mapped Originating Country],
  3. FROM OriginatingCountry
  4. WHERE OriginatingCountry.[Intermediate Originating Country] = TrafficApr11toDate.[Originating Country (Original)]);
Aug 21 '14 #1

✓ answered by jforbes

I think this is what you are attempting to do

Expand|Select|Wrap|Line Numbers
  1. UPDATE TrafficApri11toDate 
  2. LEFT JOIN OriginatingCountry 
  3. ON TrafficApri11toDate.[Originating Country (Original)] = OriginatingCountry.[Intermediate Originating Country] 
  4. SET TrafficApri11toDate.[Originating Country] = [OriginatingCountry].[Mapped Originating Country];
Access does things a little strange sometimes when using the Query Editor. It always makes me uncomfortable when there is no FROM statement.

2 1120
jforbes
1,107 Expert 1GB
I think this is what you are attempting to do

Expand|Select|Wrap|Line Numbers
  1. UPDATE TrafficApri11toDate 
  2. LEFT JOIN OriginatingCountry 
  3. ON TrafficApri11toDate.[Originating Country (Original)] = OriginatingCountry.[Intermediate Originating Country] 
  4. SET TrafficApri11toDate.[Originating Country] = [OriginatingCountry].[Mapped Originating Country];
Access does things a little strange sometimes when using the Query Editor. It always makes me uncomfortable when there is no FROM statement.
Aug 21 '14 #2
Thanks very much .....that's sorted it out although you did throw me for 10mins as one of the tables got renamed in your reply ;-).
Aug 21 '14 #3

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

Similar topics

3
by: Colin Spalding | last post by:
In Access, if I want to update one table with information from another, all I need to do is to create an Update query with the two tables, link the primary keys and reference the source...
1
by: Aaron | last post by:
Hello fellow programmers, I am trying to run an append/update query from code, a command button on a form initiates the queries. the format i am using is; ...
1
by: sudonim1234 | last post by:
My company receives a CD every month with US Gov. information about imports and exports from the US. One of the things we have to do with this before it is useable is to clean the data up. There...
11
by: DFS | last post by:
Architecture: Access 2003 client, Oracle 9i repository, no Access security in place, ODBC linked tables. 100 or so users, in 3 or 4 groups (Oracle roles actually): Admins, Updaters and ReadOnly....
16
by: ARC | last post by:
Hello all, So I'm knee deep in this import utility program, and am coming up with all sorts of "gotcha's!". 1st off. On a "Find Duplicates Query", does anyone have a good solution for...
4
by: dougmeece | last post by:
Morning Everyone... I have a table that needs to be append to and also updated. All the fields in the table are populated with data from the text boxes and combo boxes on a form. The Date...
7
by: luciquar | last post by:
I am a PhD student in demography and I am working with a Microsoft Access database in which I have to use several update queries. Amongst these there are some in which I have to update the value of...
3
by: Kunal Desale | last post by:
Hi, How to insert/update data in foxpro table field having datatype MEMO using Linked Server? I have written sql insert queries in which i have used linked server to insert data into foxpro...
2
by: simon penny | last post by:
I have a table in which I record referral records. I have a second table in which I record service records. One referral can have many service records attached. The tables are linked by referral ID -...
10
by: GirthJohnson | last post by:
I'm building an automated report and need to be able to update a table with update queries before exporting the text files through my module. I'm still a bit of a noob when it comes to VBA and I've...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.