AVG is an aggregate function, therefore anything that isn't averaged should
be in a group by clause:
group by tbl_Market_Seller_Assessment.EmployeeID, tbl_Employee.EmployeeID,
tbl_Employee.StudioID,
tbl_Studio.StudioID, tbl_Studio.StuShort
-----Original Message-----
From: Paul Ihrig [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 15, 2001 2:07 PM
To: CF-Talk
Subject: Query Help :: aggregate function error
please bear with me.
i am going to have like 12 queries
here is 1 of them below.
i am trying to do a bunch of averages based upon what employees in what
specific studio, has voted on
do i need to move the
but i get this error:
Error Diagnostic Information
ODBC Error Code = 37000 (Syntax error or access violation)
[Microsoft][ODBC Microsoft Access Driver] You tried to execute a query that
does not include the specified expression 'EmployeeID' as part of an
aggregate function.
The error occurred while processing an element with a general identifier of
(CFQUERY), occupying document position (3:1) to (3:139).
-paul
<cfquery name="Admin" datasource="Marketing_Survey">
SELECT
AVG(Studio_01) AS Studio_01q,
AVG(Studio_02) AS Studio_02q,
AVG(Studio_03) AS Studio_03q,
AVG(Studio_04) AS Studio_04q,
AVG(Studio_05) AS Studio_05q,
AVG(Studio_06) AS Studio_06q,
AVG(Firm_01) AS Firm_01q,
AVG(Firm_02) AS Firm_02q,
AVG(Firm_03) AS Firm_03q,
AVG(Firm_04) AS Firm_04q,
AVG(Firm_05) AS Firm_05q,
AVG(Firm_06) AS Firm_06q,
AVG(Personal_01) AS Personal_01q,
AVG(Personal_02) AS Personal_02q,
AVG(Personal_03) AS Personal_03q,
AVG(Personal_04) AS Personal_04q,
AVG(Personal_05) AS Personal_05q,
AVG(Personal_06) AS Personal_06q,
tbl_Market_Seller_Assessment.EmployeeID, tbl_Employee.EmployeeID,
tbl_Employee.StudioID,
tbl_Studio.StudioID, tbl_Studio.StuShort
FROM tbl_Market_Seller_Assessment, tbl_Employee, tbl_Studio
WHERE tbl_Market_Seller_Assessment.EmployeeID = tbl_Employee.EmployeeID
AND tbl_Employee.StudioID = tbl_Studio.StudioID
AND tbl_Studio.StuShort = A
</cfquery>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists