Results 1 to 5 of 5
  1. #1
    Steve Is Me is offline Novice
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    3

    averaging in a crosstab query

    I use a crosstab query to monitor item usage. The query groups usage by month.
    There is a field that calculates the monthly average.
    Currently the number of months has to be changed manually for the appropriate number of months depending on when it is run.
    This is it..Mthly: Sum([Quantity]/4)
    Where 4 is the number of months. Is there a way to write this so it can be automatic based on the system clock?


    Such as if run in March, it would be a 3, if in November it would be 11.
    And thus eliminating the need to manually change it every time it is run?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,649
    Try:

    Sum([Quantity] / Month([Date]))
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Steve Is Me is offline Novice
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    3
    No sale. Tried it, get error msg does not recognize [Date] as valid field name or expression.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,649
    Sorry for my typo:

    Sum([Quantity] / Month(Date()))
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Steve Is Me is offline Novice
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    3
    Well, all hail June7!!! Seems to work. Will continue to evaluate.

    Thanks and more thanks!!!

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

Similar Threads

  1. Replies: 0
    Last Post: 06-19-2014, 05:06 PM
  2. Averaging one column in a report
    By FranCorona in forum Reports
    Replies: 7
    Last Post: 08-02-2013, 03:42 PM
  3. Need Help Averaging A Pivot Chart
    By azeotrope in forum Reports
    Replies: 8
    Last Post: 06-26-2013, 10:33 AM
  4. Averaging with a blank field
    By Gabriel2012 in forum Access
    Replies: 3
    Last Post: 12-06-2012, 12:36 PM
  5. Averaging with a conditional check
    By sarah in forum Queries
    Replies: 1
    Last Post: 10-05-2009, 05:11 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