dbpSum

Purpose:

Calculate the sum of a single field from each record in a table. If a search query is active, only records matching the query will be included in the calculation. This action could be used to calculate the total value of all items in an inventory or sales table.

Category:

Math

Syntax:

dbpSum "database id" "table" "field" "variable"

database id

The name assigned to the database.

table

The name of the table.

field

The name of the field to be used for the calculation. The field must be a compatible numeric data type.

variable

The name of the variable where the calculated value will be stored. The value will be formatted using the field's display format as specified in dbpSetFieldProperties.

Example:

dbpSum "DB1" "Payments" "Amount" "[TotalValue]"

SQL Equivalent:


SELECT Sum(field) FROM table


dbpMin

Purpose:

Calculate the minimum value of a single field from each record in a table. If a search query is active, only records matching the query will be included in the calculation. You could use this action to examine an inventory database to determine the least expensive item in stock.

Category:

Math

Syntax:

dbpMin "database id" "table" "field" "variable"

database id

The name assigned to the database.

table

The name of the table.

field

The name of the field to be used for the calculation. The field must be a compatible numeric data type.

variable

The name of the variable where the calculated value will be stored. The value will be formatted using the field's display format as specified in dbpSetFieldProperties.

Example:

dbpMin "DB1" "Inventory" "Price" "[MinPrice]"

SQL Equivalent:


SELECT Min(field) FROM table


dbpMax

Purpose:

Calculate the maximum value of a single field from each record in a table. If a search query is active, only records matching the query will be included in the calculation. You could use this action to examine an inventory database to determine the most expensive item in stock.

Category:

Math

Syntax:

dbpMax "database id" "table" "field" "variable"

database id

The name assigned to the database.

table

The name of the table.

field

The name of the field to be used for the calculation. The field must be a compatible numeric data type.

variable

The name of the variable where the calculated value will be stored. The value will be formatted using the field's display format as specified in dbpSetFieldProperties.

Example:

dbpMax "DB1" "Inventory" "Price" "[MaxPrice]"

SQL Equivalent:


SELECT Max(field) FROM table


dbpAvg

Purpose:

Calculate the average value of a single field from each record in a table. If a search query is active, only records matching the query will be included in the calculation. You could use this action to examine an inventory database to determine the average price of all items in stock.

Category:

Math

Syntax:

dbpAvg "database id" "table" "field" "variable"

database id

The name assigned to the database.

table

The name of the table.

field

The name of the field to be used for the calculation. The field must be a compatible numeric data type.

variable

The name of the variable where the calculated value will be stored. The value will be formatted using the field's display format as specified in dbpSetFieldProperties.

Example:

dbpAvg "DB1" "Inventory" "Price" "[AvergagePrice]"

SQL Equivalent:


SELECT Avg(field) FROM table