Counting the number of events a person attended

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

Iam trying to do an update query
I have two tables
Emplyee with fields
-Inumber
-Name
-NumberEvents

Events
-EventID
-Inumber

I want the query to be able to go through the events table and count how
many events each employee has been to and update the NumberEvents field in
employee
I have been trying to this for ages and amnot sure it is even possible any
ideas would be appreciated.

Thanks
 
In your query design select the totals tool (Epsilon) and you can select
count from the dropdown.
 
It is possible to do. BUT it shouldn't be done. You should always use a
query to get the information so it is always correct based on the events the
employee attended.

SELECT Employee.INumber, Employee.Name, Count(EventID)
FROM Employees LEFT JOIN Events
ON Employees.INumber = Events.INumber
GROUP BY Employee.INumber, Employee.Name
 
yeah that worked John, thanks for your help

John Spencer said:
It is possible to do. BUT it shouldn't be done. You should always use a
query to get the information so it is always correct based on the events the
employee attended.

SELECT Employee.INumber, Employee.Name, Count(EventID)
FROM Employees LEFT JOIN Events
ON Employees.INumber = Events.INumber
GROUP BY Employee.INumber, Employee.Name
 
Back
Top