Database Wizard – Selection Statement

Database Wizard (Modification Block) – Step 4
Database Wizard (table Block) – Step 4
Database Wizard (List Block) – Step 4
Database Wizard (Detail Block) – Step 4
Database Wizard (Chart Block) – Step 4
Develop > Database > Block Properties – Selection Statement tab

This step of the Database Wizard lets you enter a SQL statement to select the records that will be displayed in the current block, and to determine their sort order.

Join

If you selected fields from two or more database tables in the Database Fields step of the Database Wizard, you must enter a statement that will determine how to relate the tables. Usually, this statement equates a field in each table with a field in every other table, so that information about corresponding records in all the tables can be displayed together. In order for two or more tables to be joined, an equivalent field must exist in each table. Use the drop-down menu to quickly enter field names and operators.

Example:
Say you have one table (Employees) that has an ID field and a Names field, and another table (Salaries) that has an ID field and a Salary field. If you want to show employee names and salaries together in one view, you would select all the fields in both tables in the Database Fields step of the Database Wizard, then enter

Employees.ID = Salaries.ID

in the Join text box.

If you selected fields from only one table in the Database Fields step of the Database Wizard, the Join input box will be disabled, since there is no need to join multiple tables.

Filter

Enter a statement that will determine which records will be shown. Use the drop-down menu to quickly enter field names and operators. Leave this text box blank to show all records.

Examples:
Employee.Salary > 45000
Employee.Salary > 45000 AND Employee.Age < 30
Employee.Salary NOT BETWEEN 45000 AND 60000

Sort by

Enter one or more field names to determine how the records will be sorted when displayed. Use the drop-down menu to quickly enter field names. To use a single sort key, simply enter one field name. To use multiple sort keys, enter multiple field names separated by commas. To sort a field in reverse order, enter “desc” after the field name.

Example:
Employee.Salary desc, Employee.Age

Database Wizard – Selection Statement