Home page
 
 Home 
 ASP 
 PHP 
 SQL 
 HTML 
 JavaScript 
 Search 
 Contact 
 


Search
or browse popular tags
Got questions?

We got answers.

Ask your question about PHP, ASP, Javascript, HTML, CSS, hosting and get professional help, free of charge.

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

Home / SQL / Access Functions

 

 

Access: Avg function

Print Bookmark and Share

In Access, the Avg function calculates the arithmetic mean of a set of values in a select query.

The syntax for the Avg function is:

Avg ( expression )

The expression argument represents a string expression identifying the field that contains the numeric data you want to average. Operands in expression can include the name of a table field, a constant, or a function (not one of the other SQL aggregate functions). The average calculated by Avg is the arithmetic mean (the sum of the values divided by the number of values). You could use Avg, for example, to calculate average freight cost.The Avg function doesn't include any Null fields in the calculation.

SQL query

In Access, you can use the Avg 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 Position, Avg(Salary) AS AvgSalary
FROM EmployeeStatisticsTable
GROUP BY Position


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

Need help with ASP, PHP, Javascript?

Let our experts help you.
 
 
ASPRunner.NET - code generator for ASP.NET
Web hosting (PHP,ASP,MySQL,SQL server,unlimited emails)



Tags: ACCESS FUNCTION AVG ARITHMETIC_MEAN SELECT QUERY

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

  • Comments





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