Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copying fields to another table

Status
Not open for further replies.

donishere

Programmer
May 7, 2002
101
Code:
[b]TABLE 1[/b]
ID  BADGE       FIRST   LAST
16	408-00-0025	JOHN	GARRETT
17	408-00-0027	KEITH	WELTER
18	408-00-0028	KRIS	HUDECK

[b]TABLE 2[/b]
ID  BADGE       SCORE
?   408-00-0025 85
?   408-00-0027 89
?   408-00-0025 80
?   408-00-0025 75
?   408-00-0028 93
?   408-00-0027 99
?   408-00-0027 79
?   408-00-0027 84
I am adding an ID field to both tables and making it the primary key for TABLE 1 so the two tables can have a relationship. Is there an automated way to copy the appropriate ID values for each Badge value from Table 1 to Table 2?

(btw, this is in MS Access)

Thanks a bunch.
 
Code:
UPDATE Table2 SET Id = Table1.ID WHERE Table2.Badge = Table1.Badge

Borislav Borissov
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top