< Day Day Up > |
Count()Category: Aggregate Syntax: Count ( field { ; field...} ) Parameters: field ”any related field, repeating field, or set of non-repeating fields; or an expression that returns a field, repeating field, or set of non-repeating fields. Parameters in curly braces {} are optional. Description: Returns the number of fields (or repetitions, in the case of repeating fields) in the parameter list that have valid non-blank values. Examples: Count ( field1 ; field2 ; field3 ) Returns 2 when field1 and field2 contain valid values, and field3 is empty. Count ( repeatingField ) Returns 2 when repetitions 1 and 2 contain valid values, and repetition 3 is empty. Count ( InvoiceItem::InvoiceID ) Returns 2 when the current record is related to two InvoiceItem records. When using the Count() function to count the number of related records, be sure to count a field that is guaranteed not to be blank, such as the table's primary key. Comments: When the parameter list consists of 2 or more repeating fields, Count() returns a repeating field in which the corresponding repetitions from the specified fields are counted separately. So if a field Repeater1 has three values, 16, 20, and 24, and another field, Repeater2 , has two values, 14 and 25, Count (Repeater1; Repeater2) would return a repeating field with values 2, 2, and 1. |
< Day Day Up > |