Using MS Access/Access 2010 SQL query

Advertisement


Question
This is the SQL Query I'm trying to create (below). But I keep getting the "You tried to execute a query that does not include the 'publisher name' as part of an aggregate expression.

SELECT AVG([Price]) AS [Average Price], [Publisher Name], [Publisher].[Publisher Code]
FROM Publisher, Book
WHERE [Book].[Publisher Code]=[Publisher].[Publisher Code]
;

Please help!

Answer
AVG is an aggregate expression that requires a Group By query. Hence the error message.

What are you trying to do? Do you want the Average price for each Publisher or each Publisher Code or what?

Hope this helps,
Scott<>
Blog: http://scottgem.wordpress.com
Website: http://www.diamondassoc.com
Microsoft Access MVP 2007
Author: Microsoft Office Access 2007 VBA

Using MS Access

All Answers


Answers by Expert:


Ask Experts

Volunteer


Scottgem

Expertise

I can answer almost all types of questions relating to Microsoft Access usage and application design. My strengths are database and interface design.

Experience

I've been designing databases for over 25 years working with dBase, FoxPro, Approach and Access.

Organizations
Author of Microsoft Office Access 2007 VBA
Techncial Editor for Special Edition Using Microsoft Access 2007 and Access 2007 Forms, Reports & Queries From Que Publishing

Education/Credentials
Brooklyn College BA

©2016 About.com. All rights reserved.