| # Query Field Data (ttadv3182s000) Use this session to define functions, ranges, and sequences for query fields. You can use this session to make a more specific query. If you do not specify functions or ranges, the values of all selected table fields are included in the query. Related topics To define a query with Easy SQL Field The code of the selected table field. Related topics To define a query with Easy SQL Function The function to be applied to the selected field. If you select a function, Tools ignores value in the Print field. As a result of this, the function is always printed. 1 Select the operator of the where condition. 1 The operand following the operator entered in the Query Operator field. Example You want to use the ttaad200.name (User Name) field in a query. To generate a where condition for this field: Select the field and select an operator. For example, Equal in Query Operator field. Enter the operand in this field. For example, John Smith. In this case, the operand is placed between quotes, as the data type of the field is string. The query contains the following sentence: where ttaad200.name = "John Smith" If there are several ranges, AND is placed between two ranges. You can use the following operands: Numeric constant (for example, 10) String constant (for example, "zzzzzz") Table fields (for example, ttaad200.user) Special fields (for example, enum constants and date) The syntax for comparing dates is: date(YYYY,MM,DD) or, date() for the current date. Reference If the table field in the data dictionary has a reference to another table, this can be made use of in the query. If this check box is selected, you can use the reference. This prevents constructions such as: where tttxt002.ctxt > 200 and tttxt002.ctxt = tttxt001.ctxt Instead, the following line is included in the where condition: where tttxt002.ctxt refers to tttxt001 and tttxt002.ctxt > 200 This prevents constructions such as: where tttxt002.ctxt > 200 and tttxt002.ctxt = tttxt001.ctxt Instead, the following line is included in the where condition: where tttxt002.ctxt refers to tttxt001 and tttxt002.ctxt > 200 Table The table to which the field is related. Print If this check box is selected, the data in the selected field is printed. Note If this check box is cleared, you cannot change the print sequence in the Print Seq. field Sort Mode In a query you can use an order by clause. You can use this clause to sort the data in the fields that must be printed. When you sort fields, the order by statement is added to the query as a last statement. If the sort is Descending, this is specified explicitly. Example order by tttxt002.clan desc If no sort sequence is specified, the sequence is assumed to be Ascending. On Form Print Seq. The sequence in which the content of the table fields is printed. Note If the Print check box is cleared, you cannot modify the print sequence. Sort Order The sequence in which the ranges of the fields that are printed can be selected on the form. Note The Sort Mode field must read Ascending or Descending. If it is not, you cannot modify the sort order. Form Seq. The sequence in which the fields appear on the form. Note If the On Form check box is cleared, you cannot modify the sequence in which the fields appear on the form. |