November 10, 2008 at 4:56 am
I have 2 tables as ahown below:
tbl_DEMOG1
PATID Name DOB Post code
NH4537 Smithe, James 12/07/1979 Se25 6xu
NH4638 Thomass, David 11/05/1978 sw15 typ
tbl_DEMOG2
PATID Name DOB Post code
NH4537 SMITH JAMES 12/07/1979 Se25 6xu
NH4638 THOMAS, DAVID 11/05/1978 sw15 typ
I need to update the Name column in tbl_DEMOG1 so that it is inthe same format as the name column in tbl_DEMOG2 where the PATID is the same. I need this for 2 reasons as the some of the names are spelt incorrectly in tbl_DEMOG1 and the format for the output needs to be in upper case.
November 10, 2008 at 6:32 am
That would just be an update statement with a join:
UPDATE tbl_DEMOG1
SET Name = D2.Name
FROM tbl_DEMOG1
INNER JOIN tblDEMOG2 D2 ON tblDEMOG1.PatID = D2.patID
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply