Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Historian

Insert a SQL query

  • Last UpdatedFeb 04, 2025
  • 2 minute read

You can either type in a SQL query or launch the Query application to allow you to build the query using a point-and-click interface.

If you want to use the Query application, you must configure at least one server connection. For more information, see Getting Started with Query.

You can insert a query into either a report document or a report template.

To insert a SQL query:

  1. Click in the location in the report document or report template where you want to insert the query.

  2. On the Historian tab, in the Edit Reports group, click Insert Query. The Direct Query dialog box appears.

  3. In the Servers list, click the name of the server to use.

  4. In the Query box, type the SQL query that are executed against the database.

    You can also click the Query Embedded Image (65% Scaling) (LIVE) button to start the Query client tool. You can use the Query client to build a query, which is inserted into the Query box. For more information, see AVEVA Historian Client Query.

  5. Configure how to display the results in the report document after it has been run.

    • Show results in a cell: Displays only the value in the first column of the first record in the returned record set. For example, if you queried the tagname and the description for a tag, only the value for the tagname is returned and displayed.

    • Show results in a table: Formats the returned data in a Word table.

  6. If you chose to format the results in a table, configure the table options.

    • Include column headings: Use the column names for the returned data as column headings in the table.

    • Show headings on every page: Allow the column headings to appear automatically on each page of the report document after it has been run, if the data table spans more than one page.

    • Format table: Click to pick the table format from a list. The Table AutoFormat dialog box appears. For more information on this dialog box, see the Microsoft Word documentation.

  7. Click OK.

    The query is inserted into the report document or report template.

TitleResults for “How to create a CRG?”Also Available in