Testing values in queries