# Defining a Query

> Source: https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/defining-a-query

When defining a query, three basic steps are involved:

|  |  |  |
| --- | --- | --- |
|  | 1\. | ***Define query characteristics.***  <br>  <br>The **[Query Header](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/query-header)** window is used to define basic file information, display options, font and color selections, and user aids. |
|  | 2\. | ***Define query contents.***  <br>  <br>The **[Query Definition](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/query-definition)** window is used to define the contents of the query by setting up cross-reference files and by defining columns and formulas. |
|  | 3\. | ***Define criteria for selecting records.***  <br>  <br>The **[Query Selection Definition](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/query-selection-criteria)** window defines filters for selecting the records to be displayed in the query. |

Access the **Query Definition** window via **[Library Object Selection](https://manual.pvxplus.com/nomads-graphical-application/nomads-development/library-object-selection/console-and-object-list)**. Click the *Query* button and enter a query name in the *Name* field (or vice versa depending on the selected **[View](https://manual.pvxplus.com/nomads-graphical-application/nomads-development/library-object-selection/menu-options#views)**) to create a new query.

You can also select the **[Query Definition](https://manual.pvxplus.com/nomads-graphical-application/nomads-development/query-def-ide)** task on the IDE Main Launcher.

*(The Query Definition task on the IDE was added in PxPlus 2023 Update 1.)*

## Query Type

When defining a ***new*** query, a prompt displays to select a *Query Type*, either ***Standard Query*** or ***Query List***.

![](https://manual.pvxplus.com/migration-assets/dd645dd43249498d1575bf882f743a80f261aca5b5bae395944e847caad40ffc.png)

This section provides information on defining a ***Standard Query***:

- Creating a ***new*** Standard query brings up the **[Query Header](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/query-header)** window.
- Modifying an ***existing*** Standard query proceeds directly to the **[Query Definition](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/query-definition)** window.

The ***Query List*** is intended for use by **Smart** controls to auto-load a list of records from a data file or database table into a control:

- Creating a ***new*** Query List brings up the **[Query Definition - File Information](https://manual.pvxplus.com/nomads-graphical-application/smart-controls/defining-smart-controls#Mark1)** window for defining the Query List header information.
- Modifying an ***existing*** Query List proceeds directly to the **[Query List Definition](https://manual.pvxplus.com/nomads-graphical-application/smart-controls/defining-smart-controls#Mark4)** window for defining the Query List contents.

See **[Smart Controls](https://manual.pvxplus.com/nomads-graphical-application/smart-controls/overview)** for information on using, defining and formatting Smart controls.
