Difference between revisions of "CNTVALUES()"
From Lianjapedia
Barrymavin (Talk | contribs) (→See Also) |
|||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
==Purpose== | ==Purpose== | ||
Function to return the number of records matching a series of keys | Function to return the number of records matching a series of keys | ||
− | |||
==Syntax== | ==Syntax== | ||
CNTVALUES([<for condition> [, <key expression>]]) | CNTVALUES([<for condition> [, <key expression>]]) | ||
− | |||
==See Also== | ==See Also== | ||
− | [[AMAX()]], [[AMIN()]], [[AVERAGE]], [[AVGVALUES()]], [[COUNT]], [[MAX()]], [[MAXVALUES()]], [[MIN()]], [[MINVALUES | + | [[ALLVALUES()]], [[AMAX()]], [[AMIN()]], [[AVERAGE]], [[AVGVALUES()]], [[COUNT]], [[MAX()]], [[MAXVALUES()]], [[MIN()]], [[MINVALUES()]], [[SUM]], [[SUMVALUES()]], [[TOTAL]] |
− | , [[TOTAL]] | + | |
==Description== | ==Description== | ||
− | |||
The CNTVALUES() function returns the number of records matching a series of keys. If no parameters are specified then the number of keys matching the current key is returned. An optional <for condition> can be specified to restrict the key count. You can also optionally specify a <key-expression> to perform the count on instead of the current key. | The CNTVALUES() function returns the number of records matching a series of keys. If no parameters are specified then the number of keys matching the current key is returned. An optional <for condition> can be specified to restrict the key count. You can also optionally specify a <key-expression> to perform the count on instead of the current key. | ||
After completion, all record pointers and indexes are returned to their original positions. | After completion, all record pointers and indexes are returned to their original positions. | ||
− | |||
==Example== | ==Example== | ||
Line 29: | Line 24: | ||
</code> | </code> | ||
− | |||
− | |||
− | |||
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:Functions]] | [[Category:Functions]] | ||
+ | [[Category:Data Analysis Functions]] | ||
+ | [[Category:Lianja VFP Extensions]] | ||
+ | [[Category:VFP Function Extensions]] |
Latest revision as of 07:20, 10 December 2012
Contents
Purpose
Function to return the number of records matching a series of keys
Syntax
CNTVALUES([<for condition> [, <key expression>]])
See Also
ALLVALUES(), AMAX(), AMIN(), AVERAGE, AVGVALUES(), COUNT, MAX(), MAXVALUES(), MIN(), MINVALUES(), SUM, SUMVALUES(), TOTAL
Description
The CNTVALUES() function returns the number of records matching a series of keys. If no parameters are specified then the number of keys matching the current key is returned. An optional <for condition> can be specified to restrict the key count. You can also optionally specify a <key-expression> to perform the count on instead of the current key.
After completion, all record pointers and indexes are returned to their original positions.
Example
use customer order title // Number of records matching the current key count = cntvalues() // Number of records matching the key "Mr" m_male = cntvalues(.T., "Mr") // Number of records matching the current key with an expiry date < today m_expired = cntvalues(expiry < date())