The fields that aren't AVG'd have to be in an aggrigate somewhere - so you
can either GROUP BY on them, or build them in another way
If you use GROUP BY, use HAVING rather than WHERE
It's late so I can't think too much on the easy way out of this...
Philip Arnold
Director
Certified ColdFusion Developer
ASP Multimedia Limited
T: +44 (0)20 8680 1133
"Websites for the real world"
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************
> -----Original Message-----
> From: Paul Ihrig [mailto:[EMAIL PROTECTED]]
> Sent: 15 August 2001 19:07
> 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