QUERY SUBRECORDS

4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next

version 3


QUERY SUBRECORDS (subtable; queryFormula)

ParameterTypeDescription
subtableSubtableSubtable to search
queryFormulaBooleanQuery formula

Description

QUERY SUBRECORDS queries subtable and creates a new subselection. This is the only command that queries subrecords and returns a selection of subrecords. The queryFormula is applied to each subrecord in subtable. If the formula evaluates as TRUE, the subrecord is added to the new subselection. When the query is complete, QUERY SUBRECORDS makes the first subrecord the current subrecord of subtable.

Remember that QUERY SUBRECORDS queries only the subrecords of the subtable contained in the currently selected parent record, and not all the subrecords associated with the records of the parent table. QUERY SUBRECORDS does not change the current parent record.

Typically, queryFormula tests a subfield against a variable or a constant, using a relational operator. The queryFormula can contain multiple tests that are joined by AND conjunctions (&) or OR conjunctions ( | ). Also, the queryFormula can be a function or contain a function. The wildcard character (@) can be used with string arguments.

If neither a current record nor a higher-level subrecord exists, QUERY SUBRECORDS has no effect.

Example

The following example queries for children older than 10 years:

   QUERY SUBRECORDS ([People]Children; [People]Children'Age>10)

See Also

ALL SUBRECORDS, ORDER SUBRECORDS BY, Records in subselection.


4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next