To make changes to an existing query yet leave the original, make a Copy of the query and make appropriate changes to the copy.
There are two methods of creating a query:
- Visual
- Text
Visual
To create a new Query using the visual method, perform the following:
- Click the New Visual button in the Query tool bar.
- The Select Schema window will prompt you to search and select a Schema. Highlight the schema you want to use and click the OK button.
- Enter a Query Name.
- Enter a Query Description.
- Select Keywords to assign to the Query. Click here to learn more about adding keywords.
- Click the Definition tab. The definition tab allows you to begin the process of selecting the rows of information you want to return. Based on the tables within the Schema chosen, the rows are categorized in the Selected Fields area.
- Select the Return all rows of in the Selected Fields pane.
- Click the Plus icon to establish a new row.
- Click the SelectField link to choose the appropriate field.
- If you want to sort the returned data, click the NotSorted link and choose the appropriate category.
- Click the Limit # of Rows to link to set a numerical value on how much data you want returned from the query.
- Repeat sub-steps 1 through 3 for each of the rows to be returned.
-
You can also change the Return all rows link.
The warning icons disappear when appropriate query criteria is chosen.
- If you want to Filter the data returned, click on the plus icon in the Filter pane.
- Click the SelectField link to choose the appropriate field.
- Click the SelectOperator and select the appropriate operator.
- Click the <Enter Value> link to enter a value based on the chosen operator. There are a few choices on this link. You can manually enter a value, select a field value from the list, or select a parameter. If no parameters have been created, you will need to create one. The parameter allows you to create a prompt for the query, ranging from a date to a decimal value. The type of parameter will depend on the fields chosen. You would not create a parameter to enter a date range on a row that includes calculated data.
- If you have completed entering and selecting the query criteria, click the blue arrow icon in the tool bar to view the data results of the query.
- If the query composition is complete, click the Save query button on the tool bar.
- Click the OK button on the Query saved window.
- After the query is saved, apears in the Query list. You may need to click the Refresh button for the newly created query to display.
Text Query
Creating a query from Text allows the use of SQL to procure the query results desired. The interface inserts a Table area, a SQL area and main area where row selection from the table occurs. Each time something is chosen, it is reflected in the SQL pane. You can manually add Case Statements and other SQL to cater to the desired result. The tool bar provides a SQL validation function as well as an advanced function that is purely a SQL editor. As with the visual editor, you can also utilize the parameters section.