UPDATE MR
SET MR.PostingDate = PR.RouteDate
FROM AKUZ.T_MEDICAL_RECORD MR
INNER JOIN AKUZ.T_PRESCRIPTION_RECORD PR
    ON MR.MedicalRecordID = PR.MedicalRecordID
WHERE PR.RouteDate IS NOT NULL;

UPDATE MR
SET MR.PostingDate = R.RecipeDate
FROM AKUZ.T_MEDICAL_RECORD MR
INNER JOIN AKUZ.T_RECIPE R
    ON MR.MedicalRecordID = R.MedicalRecordID
WHERE R.RecipeDate IS NOT NULL;
