Results 1 to 3 of 3
  1. #1
    mrr2 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2012
    Posts
    27

    Trying to take the average of a function


    is not fun. Can someone please help me reign this one in please?

    I am trying to take the difference of H0A0 and 10Yields and then create a new row that calculates the average of all of the variances in my series.

    Is that possible?

    Here is where I am stumped

    Code:
    SELECT tbl_10yr_monthly.period, tbl_10yr_monthly.px_last AS 10Yields, tbl_H0A0_monthly.px_last AS H0A0, [H0A0] - [10Yields] AS Spreads, AVG(Spreads) As Average
    FROM  tbl_10YR_monthly, tbl_H0A0_monthly

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,624
    No, the query cannot place the average in a new row.

    Avg is an aggregate function and can be used by:

    1. table, query, form in Datasheet view, select Totals from the ribbon which will open a row at bottom of the object offering aggregate functions under each field

    2. in GROUP BY (totals) query

    3. in report using Grouping & Sorting with summary calcs in header/footer sections allowing display of detail records as well as the aggregate calcs
    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
    mrr2 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2012
    Posts
    27
    Ok thanks June7, I am thinking of creating a intermediary table that calculates the average first, and referencing it in my final query to get the result I am looking for..
    THanks again -

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

Similar Threads

  1. help me get the average please! :(
    By joebox8 in forum Access
    Replies: 3
    Last Post: 07-13-2011, 08:31 AM
  2. SQl - Average Function
    By springboardjg in forum Queries
    Replies: 2
    Last Post: 05-19-2011, 08:06 AM
  3. Average function
    By rahayes in forum Queries
    Replies: 1
    Last Post: 04-10-2011, 02:44 PM
  4. Replies: 13
    Last Post: 05-28-2010, 11:57 AM
  5. Property Sheet Average Function How to do?
    By techexpressinc in forum Reports
    Replies: 2
    Last Post: 06-25-2009, 11:10 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