Home page
or browse popular tags
Access Functions

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: Count Function


In Access, the Count function calculates the number of records in a select query.

The syntax for the Count function is:

Count ( expression )

The required expression argument represents a string expression identifying the field that contains the data you want to count or an expression that performs a calculation using the data in the field. Operands in expression can include the name of a table field or function (not other SQL aggregate functions). You can count any kind of data, including text. The Count function doesn't count records that have Null fields unless expression is the asterisk (*) wildcard character. If you use an asterisk, Count calculates the total number of records, including those that contain Null fields.

SQL query

In Access, you can use the Count 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, Count(Item) AS Quantity
FROM Antiques

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


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

  • Comments

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