Format query field properly.