count multiple fields

jw08

Registered User.
Local time
Today, 18:41
Joined
Aug 14, 2012
Messages
13
Hi All

I want to count multiple fields from a table.

The table has fields like
name (john, marry etc)
Date (12/08/2012, 10/08/2012 etc)
Articalread (xxxx, xxxx, xxxx)

what I want is how many times did john read artical xxx on 12/08/2012

basically I want to take account all three fields when do the count, how should I do it?
 
First the admonishments: 'name' and 'Date' are poor field names because they are reserved words in Access. You should change them to 'Reader' and 'DateRead', otherwise Access will bark at you.

Second, what you want is fairly simple, it's called an Aggregate query (http://www.599cd.com/tips/access/aggregate-query/).

Third, this is the SQL for your specific instance:

Code:
SELECT name, Date, COUNT(Articalread) AS TimesRead
FROM YourTableNameHere
GROUP BY name, Date;

Change 'YourTableNameHere' to your actual table's name.
 

Users who are viewing this thread

Back
Top Bottom