Count Function in Access Query.

atiq

Registered User.
Local time
Today, 13:16
Joined
Apr 11, 2007
Messages
23
i'm trying to count the total number of records found for this query. i used the following expression (code) in the QED field row Total Incidents: Count([IncidentID]) which, result in an error message.

Can sum1 help me solve this problem. any help would be highly appreciated.
 
What was the error message and what are the other fields in the query? Do you have the Group By / Summary button (the little Sigma symbol) clicked on?
 
Error message

What was the error message and what are the other fields in the query? Do you have the Group By / Summary button (the little Sigma symbol) clicked on?

The error message is the following:
You tried to excute a query that does not include the specified expression ‘IncidentID’ as part of an aggregate function.

The following fields are used:
DateOfIncident, Period, Location, DateOfDetention, TimeOfDetention, DescriptionOfIncident, Decription, BehaviourType, StaffSurname, StudentSurname, StudentForename

And no i dont have the Sigma symbol on because i never used that before?

Let me know if u need any more information?
 
Are they all from one table?

By the look of the fields you supplied, I'm guessing you want the number of incidents that student was involved in?
 
Are they all from one table?

By the look of the fields you supplied, I'm guessing you want the number of incidents that student was involved in?

The fields are from three different tables which are as follows:
tblIncident
DateOfIncident, Period, Location, DateOfDetention, TimeOfDetention, DescriptionOfIncident,

tblStaff
StaffSurname

tblStudent
StudentSurname, StudentForename

tblAction
Decription

tblBehaviourType
BehaviourType

But the the tbIncident is the main table were all this data retrieved from because tblIncidents has the following relations: Staff ID, Student ID, Action ID and BehaviourType ID

i want the number of incidents students that were involved for the given results. so, basically i want another field generated from the query that would find the total number of incidents reported.

hope this helps! let me know if u need more information.
 

Users who are viewing this thread

Back
Top Bottom