TAVG

This function will retrieve the AVG of numeric records retrieved by the SQL statement.

TAVG(Field , SQL , Server)
 

PARAMETERS

Field

The field you wish to find the average of.

SQL

The SQL statement which determines which records to average.

Server

The Server used to query against .. use --- for the local device

Example:
Save the average of FIELD1 into the textbox with tag name of MYTEXT.

SETVALUE(~mytext~//TAVG({field1},"SELECT field1 FROM mytable","---"))