Display the SQL query used to generate a ticket report. The N value is either the report number of a report tag.