473,413 Members | 1,705 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

Average IF?

Is there an average if function in Access?
I need to average a field if a corresponding field matches a certian
criteria.

Field 1 field2
..5 .6
..2 .4
..6 .3
..1 .19

If field 1 is less than .25 then i want a average of field 2 for those
records.

TIA,
KO
Mar 25 '08 #1
3 6565
turtle <ko****@vistacontrols.comwrote in news:d0c9dc8c-a0da-4f1e-9ca4-
b2**********@c65g2000hsa.googlegroups.com:
Is there an average if function in Access?
I need to average a field if a corresponding field matches a certian
criteria.

Field 1 field2
.5 .6
.2 .4
.6 .3
.1 .19

If field 1 is less than .25 then i want a average of field 2 for those
records.

TIA,
KO
Perhaps, I am misunderstanding you. I believe this will calculate what I
think you want.

SELECT AVG(Field2) FROM Table1 WHERE Field1 < 0.25
Mar 25 '08 #2
On Mar 25, 4:08*pm, lyle fairfield <lylef...@yah00.cawrote:
turtle <kol...@vistacontrols.comwrote in news:d0c9dc8c-a0da-4f1e-9ca4-
b29c951e8...@c65g2000hsa.googlegroups.com:
Is there an average if function in Access?
I need to average a field if a corresponding field matches a certian
criteria.
Field 1 * field2
.5 * * * * * *.6
.2 * * * * * *.4
.6 * * * * * *.3
.1 * * * * * *.19
If field 1 is less than .25 then i want a average of field 2 for those
records.
TIA,
KO

Perhaps, I am misunderstanding you. I believe this will calculate what I
think you want.

SELECT AVG(Field2) FROM Table1 WHERE Field1 < 0.25
Damn now I feel stupid.
Mar 26 '08 #3
On Mar 26, 2:23*pm, frogste...@yahoo.com wrote:
On Mar 25, 4:08*pm, lyle fairfield <lylef...@yah00.cawrote:


turtle <kol...@vistacontrols.comwrote in news:d0c9dc8c-a0da-4f1e-9ca4-
b29c951e8...@c65g2000hsa.googlegroups.com:
Is there an average if function in Access?
I need to average a field if a corresponding field matches a certian
criteria.
Field 1 * field2
.5 * * * * * *.6
.2 * * * * * *.4
.6 * * * * * *.3
.1 * * * * * *.19
If field 1 is less than .25 then i want a average of field 2 for those
records.
TIA,
KO
Perhaps, I am misunderstanding you. I believe this will calculate what I
think you want.
SELECT AVG(Field2) FROM Table1 WHERE Field1 < 0.25

Damn now I feel stupid.- Hide quoted text -

- Show quoted text -
SELECT AVG(Field2) FROM Table1 WHERE Field1 < 0.25
This would work fine, if all you wanted to obtain was that average.
But if there are other calculations in the query you'd need a select
for each calculation.

- GL
Mar 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Sara | last post by:
I am trying to find the average number of products of the set that is on rows...dynamically. For example, if I had states on rows and was looking at the average number of products, I would see...
2
by: Karen | last post by:
I inserted this statement and it worked great for the customers that have no payment history, but for the customers that have a history and an open invoice, it still used today's date in the mix...
6
by: J | last post by:
Kind of new at programming/vb.net. I'm doing this junky die roller program. Heres's what is supposed to happen: Roll 2 6-sided dies. Add rolls together put total in rolls(d6total). Display...
4
by: Gary | last post by:
Hi, I have a temperature conversion program down pat, but I was told to add an average, meaning, i need to get the average temperature for as many times as it was entered. i do not know where to...
3
by: C++Geek | last post by:
I need to get this program to average the salaries. What am I doing wrong? //Program to read in employee data and calculate the average salaries of the emplyees.
3
by: simpleeshelbee | last post by:
Hey guys, This is my second post and is URGENT!!!! My final assignment is due tonite for class and I have no idea how to write this program right! I am supposed to write a program that uses a...
3
by: mochatrpl | last post by:
I am looking for a way to make a query / report display the running average for total dollars. I have already set up a query to provide totals dollars per day from which a report graphly shows...
3
by: Salad | last post by:
http://www.mathwords.com/w/weighted_average.htm At the above link gives an example of a weighted average. It uses the following example: Grades are often computed using a weighted average....
3
by: vileoxidation | last post by:
Hello, and thanks for any help in advance! Basically, as the title says, I am looking for a way to print the number of times the user gave the program an input, and then also print the average of...
5
by: p3rk3le | last post by:
So, I'm about to do a sequential search on a table (n contents) of random numbers. I have to print the average between the number of comparisons and the contents of the table (n) and the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.