Create a Pass-through SQL Query

Path: Reporting > Ad Hoc Reporting > Filter Designer

Use a Pass-through SQL Query to create custom filters that return data not available through standard Query Wizard options. Pass-through queries allow you to search additional tables and views, create custom joins, and use SQL functions to return targeted data sets. This guide explains how to create, test, and save a pass-through SQL query filter.

Screenshot of the Filter Designer page with a Saved Filter list displaying multiple student filters and options to create a new filter using Query Wizard, Selection Editor, or Pass-through SQL Query. The Pass-through SQL Query option is selected, and data type choices for Student, Census/Staff, and Course/Section are available.l.Create a new ad hoc filter and select the method and data source for retrieving report data.

Before you start

  • Pass-through queries require a basic understanding of SQL and familiarity with the Campus data schema.
    • Authorized Technical Support Contacts can request a copy of the Campus schema from their Infinite Campus Client Relationship Manager.
  • When creating student- or course-based queries, select the appropriate year, school, and calendar in the Campus toolbar before creating the query.
  • Unless All School is selected, student and course data is limited to the selected calendar. Census/Staff data is not dependent on calendar selection.  
  • Set appropriate tool rights. Refer to the Filter Designer Tool Rights article for more information.

Create a Pass-through SQL Query

  1. Select the Pass-through SQL Query Filter Type.
  2. Select a Data Type. The selected data type determines which fields are available when building the filter. 
    • Student
    • Census/Staff
    • Course/Section
  3. Click CreateScreenshot of Ad-Hoc Pass-through SQL Query Editor with fields for filter details, SQL query entry areas, a Test Query Results panel, and options to save the query to a user account folder or user group. Test Query, Save, and Return To List buttons appear at the bottom.Create, test, and save a pass-through SQL query for use in ad hoc filtering and reporting.
  4. Enter a Filter Name.
  5. Enter a Short Description and/or Long Description to provide additional information and context about the filter. Select the (+) icon to access the Long Description text box.
  6. In the first query field, add SQL statements that extend the predefined SELECT DISTINCT statement. Use this area to join tables or views as needed. 
  7. In the second query field, enter additional query criteria for the WHERE clause. You can also include GROUP BY and HAVING clauses when used together.
  8. NOTE
    • Copying and pasting SQL from word-processing software is not recommended. 
    • Semicolons (;) are not allowed in pass-through queries. 
    • The FROM and WHERE sections accept and save subqueries
    • Nested SELECT statements and ORDER BY clauses are not supported. Queries containing ORDER BY may test successfully but fail when used as saved filters. 
    • All quotation marks in SQL statements must be straight single quotes ('). Curly quotes copied from word-processing applications can cause query errors. 
  9. Click Test Query to validate the query and review the results.
  10. Select where to save the filter:
    • User Account to save to your account or a folder.
    • User Groups to save one or more copies for user groups. Each group receives its own editable copy.
  11. Click Save.
  12. Click Return to List to navigate back to the Filter Designer home page.

Impact

The saved query appears in the Saved Filter list in Filter Designer and can be used in reporting tools such as Letter Builder/Letter Designer.


Select calendars for saved queries

For saved Student and Course/Section pass-through queries, you can choose which calendars to include when running the query.

  1. Open a saved Student or Course/Section pass-through query.
  2. Select one or more calendars by:
    • Active year
    • School name
    • Year
  3. Run the query.

Calendars are only available when you have rights to those calendars. Refer to the User Group Calendar Rights article for more information. 

Impact

The query returns results only from the selected calendars.


What's next