Results 1 to 4 of 4

Thread: Avg Function not working in Access

  1. #1
    Join Date
    May 2009
    Posts
    41

    Avg Function not working in Access

    Hi,

    I want o remove average of two columns in Microsoft Access for that i have use avg() function.But when I am attempting to do this instead of average of two columns i am getting summed totals.I don't know what's my mistake can one tell me my mistake.

  2. #2
    Join Date
    Jan 2008
    Posts
    3,755

    Re: Avg Function not working in Access

    Avg is a group function in Access.This is not as same as average function which we had in other, it's totally based on group.So if the group contains only 1 instance.Then avg() will be the same value of the underlying field or expression.

  3. #3
    Join Date
    May 2008
    Posts
    2,297

    Re: Avg Function not working in Access

    In Access SQL function, Avg is based on rows not columns
    for example if a table contains two fields
    [Data1] and [Data2]

    If the table has 2 rows

    Row 1 [Data1]=3 [Data2]=4
    Row 2 [Data1]=5 [Data2]=6

    then fro removing average of this two columns in Access you need to write it as Avg([Data1]+[Data2])=[(3+4)+(5+6)]/2=9.

    Over here i have divide it by 2 because there are 2 rows in this example.

  4. #4
    Join Date
    Dec 2008
    Posts
    123

    Re: Avg Function not working in Access

    You can also use the Avg function in the query design grid, in an SQL statement in SQL view of the Query window, or in an SQL statement within Visual Basic code.

    For example

    SELECT Position, Avg(Sal) AS AvgSal
    FROM EmployeeStatisticsTable
    GROUP BY Position

Similar Threads

  1. Replies: 5
    Last Post: 28-06-2011, 11:08 AM
  2. CMD+TAB function not working in mac os
    By Stranger01 in forum Operating Systems
    Replies: 3
    Last Post: 08-12-2010, 01:00 PM
  3. I need a search function for my access database.
    By Superstar9 in forum Windows Software
    Replies: 3
    Last Post: 02-09-2009, 11:33 PM
  4. Date() function problem in Access 2000.
    By Jerzy in forum Software Development
    Replies: 3
    Last Post: 30-07-2008, 03:44 PM
  5. Excel function calculations used in MS Access query
    By akbar in forum MS Office Support
    Replies: 1
    Last Post: 23-05-2008, 08:52 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,881,724.77477 seconds with 16 queries