Search these areas:
Help
Support Forums
Product Info



Introduction
DataWeb: What's New
Creating an Application
The DataWeb Designer
Application Management
Data Tables
Data Tables
Views
Templates
Components
Data Analysis
-Adding Totals to Your View
-Aggregating View Data
-Using Aggregation Functions in Script
Members
Security
Importing
Exporting
FTP
JavaScript
Object Model
Full-Text Search
Domain and Email Hosting
HotBlock Modules
Account Management
Glossary
New Responsive UI Module





DataWeb Help
Support Forums
Tutorial
Script Library
Knowledge Base

Home > Support

DataWeb User's Guide

Using Aggregation Functions in Script
You can use aggregation functions in script to generate a resultset with totals. The Min, Max, Average, Count, and Sum functions are all available to you in script.

For example, to find the maximum value of the UnitPrice field in a Products table in script, you can create a resultset as follows, and write the value to the browser:


var rs = new Resultset("Products", 
  "MaxPrice = Max(UnitPrice)", "*");
if(rs.next())
   response.write(rs.MaxPrice);

In the columns argument for the Resultset object constructor, you specify a name for the totals field, followed by an equals sign and an expression including the aggregate function and the field name.
Affiliate | Partner | Terms of Use | Privacy Policy | Contact Us | Pricing | Bring DataWeb In-House    
DataWeb, 720 North 10th Street, A #145, Renton, Washington 98057 *425-583-5970* Fax 484-770-4706* Email Us