Link to home
Start Free TrialLog in
Avatar of al4629740
al4629740Flag for United States of America

asked on

transfer data in one table to another table's column

I have two tables.  AttendanceGrid and frmRegistrationCSW.  AttendanceGrid has duplicated IDs and frmRegistrationCSW has NO duplicated IDs

I have several records in frmRegistrationCSW where the ID is related to the ID in AttendanceGrid.  For example ID # 784 in frmRegistrationCSW is the referenced to ID # 784 in AttendanceGrid

There is an Age column in frmRegistrationCSW that I would like to copy to all equivalent records in AttendanceGrid.AgeReg

Is the following code correct for doing this?

UPDATE R14
SET R14.AgeReg= R13.Age
from AttendanceGrid R14
INNER JOIN frmRegistrationCSW AS R13
      ON R13.ID = R14.ID
      AND R13.fiscal = 2014

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of sameer2010
sameer2010
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial