Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display all people, even if they have attended 0 events 1

Status
Not open for further replies.

cpc34

Technical User
Aug 16, 2005
22
GB
My database stores people and the events they have attended. I have a group of 100 people in the database and want to count the number of events each has attended. I have the total list of people in "People list", a list of events in "Events table" and a linking table (which has rows that store all the links between the two: a1,a2,b1,b2,b3,b4,c1...). Currently, to count the number of events each person has attended I am using the count function on the link table. Unfortunately, this does not display any of the people who have not yet attended an event. Is there a way of displaying all the people in "People list", count the number of times they occur in the link table, and displaying "0" for those that have not attended anything?
 
Have you tried altering the join property between the tables? Should work if you set it to an outer join (double click on join, select the first option so the join line turns into an arrow)
 
Many thanks. It worked a treat.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top