Fix sql generating for EntityFunctions.DiffYears