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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SELECT COUNT ??? 1

Status
Not open for further replies.

JeroenB

Programmer
Apr 8, 2001
93
BE
Hi I have the following SQL-statement in MS Access

SELECT TYPE_DEUREN.[TYPE-NR], count ([5_Deuren].[Deur-nr]) AS AantalDeuren
FROM TYPE_DEUREN INNER JOIN 5_Deuren ON TYPE_DEUREN.[TYPE-ID] = [5_Deuren].[TYPE-ID]
ORDER BY TYPE_DEUREN.[TYPE-NR];

I get the error "You tried to execute a query that does not include the specified expression 'TYPE-NR' as part of an aggregate function'

I want to have al list of the TYPE-NR and the number of 'Deur-nr' for each of these TYPE-NR.

Can someone help me out ?

thanx
jeroenB
 

add GROUP BY TYPE_DEUREN.[TYPE-NR] just before the ORDER BY

rudy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top