converts a query to a form