SUM
The Summation function will take a column or calculation over a table and return the values added together.
Syntax :
SUM(Expression,[Condition])
| Parameters | Description |
|---|---|
| SUM(Expression) | Summation of al values. |
| SUM(Expression,Value>=3) | Summation of all values greater or equal to 3. |
Examples :
Table Name : Products
| ProductID | Product Name | Price |
|---|---|---|
| 1 | Pen | 6 |
| 2 | Pencil | 3 |
| 3 | Eraser | 2 |
| 4 | Bottle | 5 |
| 5 | Book | 10 |
Example 1
dSum = Sum(Price)
DEBUG(dSum)
Result :
dSum
= 26
Example 2
dSum = Sum(Price, Price>=3)
DEBUG(dSum)
Result :
dSum
= 24