Debugging aggregate function message

  • Thread starter chris0309 via AccessMonster.com
  • Start date
C

chris0309 via AccessMonster.com

Im using the code below to work out the difference between the two date and
time columns (that works) however im then trying to work out an average run
but getting the same message "you tried to execute a query that does not
include the specified expression "ID" as part of an aggregate function". Can
anyone help to debug. Code im using is below.


Expr3: Avg(DateDiff("h",[Date and Time Started],[Date and Time Finished]))

Thanks.
 
J

John Spencer

It helps if you post your entire query instead of just one expression.
(Open the query in SQL view and copy and paste the code)

If you are using Avg on a field (or expression), then you need to group
by other fields, not show them in the result, or use one of the other
aggregate functions on the fields.

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top