Tuesday, September 15, 2015

Count Function

Source: http://www.techonthenet.com/access/functions/numeric/count.php


MS ACCESS: COUNT FUNCTION

This MSAccess tutorial explains how to use the Access Count function with syntax and examples.

DESCRIPTION

The Microsoft Access Count function returns the number of records in a select query.

SYNTAX

The syntax for the Count function in MS Access is:
Count( expression )

Parameters or Arguments

expression
A field or any string expression.

APPLIES TO

The Count function can be used in the following versions of Microsoft Access:
  • Access 2013, Access 2010, Access 2007, Access 2003, Access XP, Access 2000

EXAMPLE IN SQL/QUERIES

You can use the Count function in a query by clicking on the Totals button in the toolbar (This is the button with the summation symbol). The Count function is used in conjunction with the Group By clause.
For example:
Microsoft Access
This query would return the number of records for each ProductName. You can actually substitute any field with the Count function and it will return the same count result. In this case, we've used the SupplierID field to determine the number of records for each ProductName.