Home page
 
 Home 
 ASP 
 PHP 
 SQL 
 HTML 
 JavaScript 
 Search 
 Contact 
 
Search
or browse popular tags
Access Functions
Subscription

Sign up for the free email newsletter for new tips, tutorials and more. Enter your email address below, and then click the button.

Privacy Policy

RSS Twitter

Access: Sum Function

Print

In Access, the Sum function returns the sum of a set of values in a set of values in a select query.

The syntax for the Sum function is:

Sum ( expression )

The expression argument represents a string expression identifying the field that contains the numeric data you want to add or an expression that performs a calculation using the data in that field. Operands in expr can include the name of a table field, a constant, or a function (not one of the other SQL aggregate functions). The Sum function totals the values in a field. It ignores records that contain Null fields.

SQL query

In Access, you can use the Sum function in the query design grid, in an SQL statement in SQL view of the Query window, or in an SQL statement within Visual Basic code. It is used in conjunction with the Group By clause.

Select SellerID, Sum(Price) as TotalSum
From Antiques
Group by SellerID
Having Sum(Price)>57


If you'd like to see how it works, enter SQL statement and press Execute
 




Tags:

Add To: Add to dzone dzone | Digg this digg | Add to del.icio.us del.icio.us | Stumble it stumbleupon

  • Comments





Copyright © 2005-2014             www.WebCheatSheet.com All Rights Reserved.