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!

Query to count related records in child table

Status
Not open for further replies.

Domino2

Technical User
Jun 8, 2008
475
GB
I seem to be going round in circles with the query design grid, can never fathom out grouping. All I am trying to do is fill a list with 2 columns. The first column is the Company Name from a Parent Table - Partners. In column 2 of the list I am trying to insert a counted figure for each record in held in table 2, (child table - Activities) for each Partner record.

Table 1 Table 2
Partner Name Related Records Count
Microsoft 4
Samsung 7
etc etc

Appreciate guidance/fix


 
Can you show the SQL of the query you are trying?
 
Thanks, because it was urgent went oss site and resolved

SELECT PARTNERS.Partner, Count(ACTIVITIES.ID1) AS CountOfID1
FROM PARTNERS INNER JOIN ACTIVITIES ON PARTNERS.ID1 = ACTIVITIES.ID1
GROUP BY PARTNERS.Partner;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top