473,383 Members | 1,785 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,383 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 1118
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...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
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...

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.