modify the sql based on 3 new columns in word table