Results 1 to 3 of 3
  1. #1
    Gdm is offline Novice
    Windows XP Access 2010 (version 14.0)
    Join Date
    May 2010
    Posts
    28

    Question Error: you tried to execute a query that does not include...

    I am getting the following error on this query:



    Error: you tried to execute a query that does not include the specified expression '...' as part of an aggregate function.

    Here is the query:

    SELECT DISTINCTROW
    TeacherID,
    TeacherName,
    FeesRequired,
    SubTotal
    FROM MyQuery
    GROUP BY
    TeacherID,
    TeacherName,
    FeesRequired,
    SubTotal
    HAVING (SubTotal < FeesRequired)

    I also tried WHERE, but get other errors.
    Help is most appreciated.

  2. #2
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    How about this instead:

    Code:
    SELECT DISTINCTROW MyQuery.TeacherID, MyQuery.TeacherName, MyQuery.FeesRequired, MyQuery.SubTotal
    FROM MyQuery
    WHERE (((MyQuery.SubTotal)<[FeesRequired]))
    GROUP BY MyQuery.TeacherID, MyQuery.TeacherName, MyQuery.FeesRequired, MyQuery.SubTotal;

  3. #3
    Gdm is offline Novice
    Windows XP Access 2010 (version 14.0)
    Join Date
    May 2010
    Posts
    28
    Thanks, boblarson, you got it first time!
    With some minor tweaks, I have exactly the results I wanted.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Query results to include descriptions
    By funkygoorilla in forum Queries
    Replies: 4
    Last Post: 02-07-2012, 11:07 AM
  2. Include zero values in below query!
    By daffykyle in forum Access
    Replies: 3
    Last Post: 11-30-2011, 08:56 AM
  3. Replies: 3
    Last Post: 12-23-2010, 10:23 AM
  4. db.Execute Error 3061
    By JimG in forum Programming
    Replies: 5
    Last Post: 05-17-2010, 09:34 AM
  5. Can't get any of my code to execute!
    By blacksaibot in forum Programming
    Replies: 4
    Last Post: 03-16-2010, 08:08 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums