I have a table (TABLE1) that is updated by a second table (TABLE2) based on a field that is common to both tables (CODE#). For each CODE# match, there are from one to three TABLE1 fields (TYPE1,TYPE2,TYPE3) updated with data from a single TABLE2 field (GROUP). On a match, the first GROUP value must go in TYPE1, the second in TYPE2, etc. So how do I SET the reference of TABLE1.TYPE(1-3) to TABLE2.GROUP?
TABLE1
CODE# TYPE1 TYPE2 TYPE3
1234
TABLE2
CODE# GROUP
1234 4
1234 2
1234 7
Here's what I have so far:
UPDATE TABLE1 SET
TABLE1.TYPE1 = TABLE2.GROUP ???
TABLE1.TYPE2 = TABLE2.GROUP ???
TABLE1.TYPE3 = TABLE2.GROUP ???
FROM TABLE1
INNER JOIN TABLE2
ON TABLE1.CODE# = TABLE2.CODE#
Thanks in advance.
TABLE1
CODE# TYPE1 TYPE2 TYPE3
1234
TABLE2
CODE# GROUP
1234 4
1234 2
1234 7
Here's what I have so far:
UPDATE TABLE1 SET
TABLE1.TYPE1 = TABLE2.GROUP ???
TABLE1.TYPE2 = TABLE2.GROUP ???
TABLE1.TYPE3 = TABLE2.GROUP ???
FROM TABLE1
INNER JOIN TABLE2
ON TABLE1.CODE# = TABLE2.CODE#
Thanks in advance.