Simple update Query

M

mcnaught

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
 
J

John Spencer

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 Council field from Table A to the list of fields
-- Select Query: UPdate from the menu
-- Type the following in the UPDATE TO "cell" under the Council field
[Table b].[Council]
-- SELECT Query : Run from the menu

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================
 
Top