Hello! merge(TablePatient, TableSpecial, by.x="ID", by.y="PATIENTID") works fine for me. (There is also a variable ID in TableSpecial). One problem - or what has to be known - is that merge is using the levels, not the labels, if the merged variables are factors. Karl