|
| Contents | Index Define Query dialog box ODBC Queries are defined in the Define Query dialog box, available after navigation through one or more dialogs from the New ODBC Query option on the Data menu. ODBC Queries existing within a qdb data file may be amended in the same dialog, available by selection of the Amend Query option on the Data menu. This option is only available when a Data Editor is the current window, and that editor has an ODBC query contained within it. Note: If an existing ODBC Query has been edited though change of the SQL statement using the Edit SQL dialog box, then this dialog box will appear when the Amend Query option is selected.. You may return to the Define Query dialog by selecting the Return to Query Dialog button, which warns the user that changes made to the query from the Edit SQL dialog will be lost. Thus, you may use either the Edit SQL dialog or the Define Query dialog to edit a query, but not both. The Edit SQL dialog box is available by selection of the Edit SQL button in the Define Query dialog box. Specifying Tables or Files Included in a Query Add Table / Add File: This button opens either the Add Tables or the Add Files dialog box, which allows selection of the tables (or files, for file-based databases) included in the query. Either double-click on each entry, or single click on an entry and click on the Add button, to include the entry in the list of Tables in Query in the Define Query dialog. Note: The Add Files dialog box will default to (and not allow changes from) the directory location specified in the Control Panel's ODBC Data Sources for single table files, such as Text or dbf files. Remove Table: This button is available when a table has been selected in the list of Tables in Query. Selection of the Remove Table button will remove the table from this list.. Specifying Columns or Fields Included in a Query Add Column: This button opens the Add Columns dialog box, which allows selection of the columns from the selected tables in the Tables in Query list box. Either double-click on each entry, or single click on an entry and click on the Add button, to include the entry in the list of Columns in Query in the Define Query dialog. Remove Column: This button is available when a column has been selected in the list of Columns in Query. Selection of the Remove Column button will remove the column from this list. Specifying Query Criteria Add Criterion: Select this button to open the Add Criterion dialog box, which is used to create a condition by which to limit the query . This button is only available when at least one table is included in the query definition. As criterion are added to the query definition, they are shown in the Criteria in Query list box. Edit Criterion: Select this button to open the Edit Criterion dialog box, which is used to edit a condition by which to limit the query . This button is only available when at least one criterion is included in the query definition. Remove Criterion: Select this button to remove a selected Criterion from the query. This button is only available when a Criterion has been selected in the list of Criteria in Query. Specifying Joins Add Join: Select this button to open the Add Join dialog box, which is used to create a condition by which to limit the query . This button is only available when at least one table is included in the query definition. As criterion are added to the query definition, they are shown in the Criteria in Query list box. Edit Join: Select this button to open the Edit Join dialog box, which is used to edit a condition by which to limit the query . This button is only available when at least one criterion is included in the query definition. Remove Join: Select this button to remove a selected Join from the query. This button is only available when a Join has been selected in the list of Joins in Query. Sorting the Results of a Query Selection of the Sort By button opens the Sort Query By dialog box, which allows selection of up to three columns (or database fields) by which to sort the query results. Each of the column combo boxes contains a list of all the columns currently included in the query (i.e. listed in the Columns in Query in the Define Query dialog), with "(None)" at the top of each list. The First Column list is used to specify the column whose values will be sorted for the first pass. Duplicate values of this field will be sorted based on the field values of the Second Column. Duplicate values of the second column field will be sorted based upon values of the specified Third Column. Note: This sort has no impact on any other columns in the Data Editor which are not part of the Query results. However, the Data Editor Sort function, available by selection of the Sort option in the Data menu, will sort all columns in the data editor, based on columns that are query results or not, producing a separate data editor which can be stored as a new file. See also: Sorting Rows of Data |
|
|