Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Guide To Clipper - <b>average</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
AVERAGE


Syntax:     AVERAGE [<scope>] <expN list> TO <memvar list> [FOR
            <condition>] [WHILE <condition>]

Purpose:    To average a series of numeric expressions to memory
            variables for a range of records in the current database
            file.

Arguments:  <expN list> is a list of the numeric values to AVERAGE
            for each record processed.

            <memvar list> identifies the receiving memory variables
            for the averages and is created when the command executes.
            Existing memory variables with the same names are
            overwritten.  This list must contain the same number of
            elements as the list of expressions to AVERAGE.

Options:    Scope: The <scope> is the portion of the current
            database file to AVERAGE.  The default scope is ALL.

Condition:  The FOR clause specifies the conditional set of records to
            AVERAGE within the given scope.  The WHILE clause specifies
            the set of records meeting the condition from the current
            record until the condition fails.

Library:    CLIPPER.LIB


----------------------------------- Example --------------------------------

   USE Sales

   * Average a numeric field.
   AVERAGE Amount TO avg_amount FOR UPPER(Branch) = "100"

   * Average a date field.
   AVERAGE SaleDate - CTOD("00/00/00") TO avg_days FOR !EMPTY(SaleDate)
   avg_date = CTOD("00/00/00") + avg_days


See Also: SUM TOTAL

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson