Results 1 to 3 of 3
  1. #1
    wildti is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2015
    Posts
    2

    Question Avg over last 3 months query

    Hi,


    I am trying to the work out the average for a column but only taking into account lines dated in the last 3 months.

    this is what I have:
    SELECT Avg(DaysTaken) AS Expr1, tblMain.DateOnRequest
    FROM tblMain
    WHERE ((DateDiff("dd",[DateOnRequest],Date())<90));




    This is giving me this error :
    "You tried to execute a query that does not include the specified expression 'DateOnRequest' as part of an aggregate function

    Thanks in advance for your help :-)
    Attached Thumbnails Attached Thumbnails 2015-08-20 11_18_02-AFW Analytical Lab Request Database - [qryAvgResponse].png  

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    in the query , look under the field, on the TOTAL row. Its probly blank.
    Set it to sum or avg or GROUP BY, but not blank.

  3. #3
    wildti is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2015
    Posts
    2
    Hi Thanks I cant see a "total" row. Could you point me in the right direction.Click image for larger version. 

Name:	2015-08-20 13_34_32-AFW Analytical Lab Request Database - [qryAvgResponse].png 
Views:	5 
Size:	16.0 KB 
ID:	21752

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

Similar Threads

  1. Query to find records from only 6 months ago.
    By Rustin788 in forum Queries
    Replies: 4
    Last Post: 03-14-2014, 02:52 PM
  2. Replies: 3
    Last Post: 02-23-2014, 02:06 PM
  3. First of the Month, Following 2 Months in Query
    By sainttomn in forum Queries
    Replies: 5
    Last Post: 07-06-2011, 03:51 PM
  4. Replies: 0
    Last Post: 02-27-2009, 01:39 PM
  5. A months query
    By Peljo in forum Access
    Replies: 1
    Last Post: 02-18-2008, 09:07 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