Domain Aggregate Functions
by Linda Quinn
Close Window
Domain Aggregate Functions are like SQL queries.
They are easy to use in Access.
The most useful Domain Aggregate Functions are listed below:
| DAVG |
Average of the values in a set |
| DCOUNT |
Number of records in a set of records |
| DSUM |
Total of a set of records |
| DFIRST |
First record in a set |
| DLAST |
Last record in a set |
| DMIN |
Smallest value in a set |
| DMAX |
Largest value in a set |
Domain Aggregate syntax is:
DFunction(fieldname, table, [criteria] )
This is a standard SQL statement.
It will return the SUM of all amounts in the Balance_Due field from the table Invoices:
SELECT SUM(Balance_due) FROM Invoices
The equivalent DSUM statement is:
DSUM("Balance_due", "Invoices")
Here is an example where the total Balances are placed in a textbox on a form.
TotalDue.text = DSUM("Balance_due", "Invoices")
This is an example of using the WHERE clause of a SQL statement:
SELECT Sum(Balance_due) FROM Invoices WHERE [CustomerID] = '32413'
The equivalent DSUM statement is:
DSUM("Balance_due", "Invoices", "[CustomerID] = '32413'")
=================================================================
This content was created by Linda Quinn of LQNet.
See http://www.lqnet.com for a great
collection of articles on this and other topics.
=================================================================
Copyright © 2006-2008, LQ Systems,Inc. All rights reserved.
====================================================================
Want an expert to help with your project?
LQ Systems, Inc.
Business Solutions
====================================================================