Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 08-05-2009
Members
 
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.
Reply With Quote
  #2  
Old 08-05-2009
Member
 
Join Date: Jan 2008
Posts: 3,751
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.
Reply With Quote
  #3  
Old 08-05-2009
Member
 
Join Date: May 2008
Posts: 2,293
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.
Reply With Quote
  #4  
Old 08-05-2009
Member
 
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
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Avg Function not working in Access"
Thread Thread Starter Forum Replies Last Post
Getting Memory Access Violation error into the RegisterClassEx function Wave Software Development 5 28-06-2011 11:08 AM
CMD+TAB function not working in mac os Stranger01 Operating Systems 3 08-12-2010 01:00 PM
I need a search function for my access database. Superstar9 Windows Software 3 02-09-2009 11:33 PM
Date() function problem in Access 2000. Jerzy Software Development 3 30-07-2008 03:44 PM
Excel function calculations used in MS Access query akbar MS Office Support 1 23-05-2008 08:52 PM


All times are GMT +5.5. The time now is 02:15 PM.