Difference between revisions of "SUMVALUES()"
Yvonnemilne (Talk | contribs) |
Helengeorge (Talk | contribs) (→SUMVALUES()) |
||
Line 1: | Line 1: | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
==Purpose== | ==Purpose== | ||
Function to returns the total value of a column for a matching series of keys | Function to returns the total value of a column for a matching series of keys |
Revision as of 16:42, 28 October 2009
Purpose
Function to returns the total value of a column for a matching series of keys
Syntax
SUMVALUES(<expN> [, <for condition> [, <key expression>]])
See Also
AVERAGE, COUNT, SUM, TOTAL, AMAX(), AMIN(), AVGVALUES(), CNTVALUES(), MAX(), MAXVALUES(), MIN(), MINVALUES(), SQLVALUES()
Description
The SUMVALUES() function returns the total value of <expN> for a matching series of keys. The required <expN> parameter must be a column name from a table. If none of the optional parameters is specified, then the number of keys matching the current key is returned. An optional <for condition> can be specified to restrict the rows included in the sum operation. You can also optionally specify a <key expression> to perform the sum on instead of the current key.
After completion, all record pointers and indexes are returned to their original positions.
Example
use customer order title // Sum the balance column for the number of records matching the current key total_balance = sumvalues(balance) // Sum the balance column for the number of records matching the key "Mr" m_male = sumvalues(balance, .T., "Mr") //Sum the balance column for the number of records matching the current key with an expiry date < today m_expired = sumvalues(balance, expiry < date())
Products
Recital Database Server, Recital Mirage Server, Recital Terminal Developer