A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Simple update Query



 
 
Thread Tools Display Modes
  #1  
Old March 16th, 2008, 11:03 PM posted to microsoft.public.access.queries
[email protected]
external usenet poster
 
Posts: 1
Default Simple update Query

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
  #2  
Old March 17th, 2008, 12:48 AM posted to microsoft.public.access.queries
John Spencer
external usenet poster
 
Posts: 2,364
Default Simple update Query

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
'================================================= ===


wrote:
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

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:31 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.