Difference between revisions of "COUNT"

From Recital Documentation Wiki
Jump to: navigation, search
 
(Products)
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
=COUNT=
 
 
 
==Class==
 
Fields and Records
 
 
 
 
==Purpose==
 
==Purpose==
 
Count records in the active table that satisfy a specified condition
 
Count records in the active table that satisfy a specified condition
Line 21: Line 14:
  
 
==See Also==
 
==See Also==
[[ACC()]], [[AVERAGE]], [[CALC()]], [[SUM]], [[TOTAL]]
+
[[ACC()]], [[AVERAGE]], [[CALC()]], [[LOCATE]], [[SEEK]], [[SET DELETED]], [[SET FILTER]], [[SUM]], [[TOTAL]]
  
  
Line 45: Line 38:
  
 
==Products==
 
==Products==
Recital Database Server, Recital Mirage Server, Recital Terminal Developer
+
Recital Server, Recital  
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Commands]]
 
[[Category:Commands]]
 +
[[Category:Table Basics]]
 +
[[Category:Table Basics Commands]]
 +
[[Category:Data Commands]]

Latest revision as of 09:57, 30 November 2009

Purpose

Count records in the active table that satisfy a specified condition


Syntax

COUNT [<scope>]

[FOR <condition>]

[TO <memvar>]

[WHILE <condition>]


See Also

ACC(), AVERAGE, CALC(), LOCATE, SEEK, SET DELETED, SET FILTER, SUM, TOTAL


Description

The COUNT command counts the number of records in the active table. If no <scope> is specified, ALL records will be counted. If SET FILTER TO is in effect, then only those records that satisfy the filter <condition> are counted. If SET DELETED is ON, then records marked for deletion will not be included in the COUNT.

FOR <condition>

If the for <condition> is used then only the records that satisfy the specified <condition> are counted.

TO <memvar>

Using the TO <memvar> clause causes the result of the COUNT operation to be stored in the specified memory variable.

WHILE <condition>

The WHILE clause can be used in conjunction with the SEEK or LOCATE commands to restrict the range of records counted. When the WHILE option is used the <scope> defaults to REST.


Example

use patrons
count to nResult for event = "CHOPIN" and date = date()


Products

Recital Server, Recital