Syntax
DbSum( bExpression, [bFor], [bWhile], [nNext], [nRecord], [lRest] ) --> nSumArguments
bExpression
Numeric expression block. Remaining arguments define the scope.
Return value
The sum of expression values in the selected records.
Description
DbSum() evaluates bExpression for records in the current work area and adds the numeric results.
Notes
An empty scope returns zero.
Example
PROCEDURE Main()
DbUseArea( .T., , "sales.dbf", "Sales" )
QOut( "Sum: " + LTrim( Str( DbSum( {|| FIELD->AMOUNT } ) ) ) )
DbCloseArea()
RETURNOutput