This example shows the benefits of the record selected formula that can be pushed to the database server.
In the order table of the Xtreme Example Database, there are 2192 records, with 181 items before 2001. Suppose you only want to tabulate these records. On the one hand, the following records can be used:
Year ({Order. Order Date}) <2001
The generated SQL query sends all 2192 records to Crystal Reports, and then records the selected formula to 181. To learn this, click "Show SQL Query" on the Database menu, you will notice that the SQL query does not have a WHERE clause. This is because Crystal Reports can't get down the Year () function in the WHERE clause.
On the other hand, the following record is generated the same report:
{Order. Order Date} <#jan 1, 1997 #
The second formula above can be executed on the database server, so it can be pushed. The generated SQL query will only send 181 records to Crystal Reports. Therefore, the record is not required to further eliminate the record when the recorded selection formula is evaluated by Crystal Reports. Click "Show SQL Query" on the Database menu, you will notice that there is a WHERE clause in the generated SQL query.
As shown in this example, the processing speed of the report is improved after improved record selected formula. In this example, two formulas generate the same report, but the second formula uses the function and optimization of the database server when processing its data.
Tip: Please see the section of the "Record Selected Performance Tips" section to learn about other information and settings to record the restrictions.
To learn more about writing an efficient record selected formula, read the rest of this section: Use enhanced records to select the formula.
Note: If you are not familiar with the record selected formula, you can start learning from "Select Expert" or record the selected formula sample template. For more details, please refer to Select Record.