473,756 Members | 4,444 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trying to filter data as I summarize in Query

I am using Access 2000. I am trying to summarize numeric data from a
large database. The problem is that I need the summarization functions
to ignore "junk" data, defined in a couple ways.

Assume an excerpt of the database table looks like this:

Lot SerialNumber Status Error
101 001 Good .3
002 Good .2
003 Mach Fail .4
004 Bad .35
005 Good .2
006 PriorOp Fail.3
102 001 Bad 1.2
002 Good .12
003 Good .22
004 Good .34
005 Bad .2
Etc....

Now, I want to run a query that reports the data in this format:

Lot Lot_Count Avg_Error
101 6 .26
102 5 .22
Etc....

The query will list every lot in the table, the number of entries per
lot, and the average of the errors for all entries per lot. I am able
to make Access do this. Here is my problem:

I want to filter the data such that the query returns the average error
per lot, only including data that has a "Good" or "Bad" status, and
only data that has errors between -1 and +1. So in the data above,
SerialNumbers 003 and 006 from lot 101 would not be included in the
average error calculations for lot 101 because of their status, and
serialnumber 001 from lot 102 would not be included because it is >+1.

Here is how I set up my query so far:
In design view, I drag "Lot" into the first column. Then I drag "Lot"
into the 2nd column. I click on the "Total" tool in the toolbar, and
change the "Total" entry in the 2nd column to "Count". Then I drag
"Error" into the 3rd column, and set the "Total" entry to average. Like
I said, this works, but doesn't provide the data filtering I require. I
do not know how to add the filtering.

Thanks.

Nov 13 '05 #1
2 1765
any reason you can't use a base query to filter out the stuff you don't
want?

Nov 13 '05 #2
ec*********@yah oo.com wrote:
I am using Access 2000. I am trying to summarize numeric data from a
large database. The problem is that I need the summarization functions
to ignore "junk" data, defined in a couple ways.

Assume an excerpt of the database table looks like this:

Lot SerialNumber Status Error
101 001 Good .3
002 Good .2
003 Mach Fail .4
004 Bad .35
005 Good .2
006 PriorOp Fail.3
102 001 Bad 1.2
002 Good .12
003 Good .22
004 Good .34
005 Bad .2
Etc....

Now, I want to run a query that reports the data in this format:

Lot Lot_Count Avg_Error
101 6 .26
102 5 .22
Etc....

The query will list every lot in the table, the number of entries per
lot, and the average of the errors for all entries per lot. I am able
to make Access do this. Here is my problem:

I want to filter the data such that the query returns the average error
per lot, only including data that has a "Good" or "Bad" status, and
only data that has errors between -1 and +1. So in the data above,
SerialNumbers 003 and 006 from lot 101 would not be included in the
average error calculations for lot 101 because of their status, and
serialnumber 001 from lot 102 would not be included because it is >+1.

Here is how I set up my query so far:
In design view, I drag "Lot" into the first column. Then I drag "Lot"
into the 2nd column. I click on the "Total" tool in the toolbar, and
change the "Total" entry in the 2nd column to "Count". Then I drag
"Error" into the 3rd column, and set the "Total" entry to average. Like
I said, this works, but doesn't provide the data filtering I require. I
do not know how to add the filtering.

Thanks.


Have you looked at the "Criteria" row in the query builder?

Since you want to want to filter on "Status" conditions, drag this field
into your query. You can uncheck "Show" on this column if you want.

Next, in the Criteria row under Status, put something like ='good'. In
the 'Or' row, put something like ='bad'. You can add similar criteria to
the Error column as well.

Suggestion: after playing with these options, look at your query in SQL
view. This may give you more ideas about how to filter your data.

HTH
--
Smartin
Nov 13 '05 #3

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

Similar topics

1
7850
by: Robert Neville | last post by:
I would like to add filter functionality to my database whether through the Main form or the subform. This question may be rudimentary, yet I have not less experience with filtering data outside from queries. Let me just add that Allen Browne excellent article about this subject may not apply to this scenario on an elementary level. (Here's the link to the article; Filter a Form on a Field in a Subform -...
11
2604
by: hazz | last post by:
before I start filling up the first page of perhaps many pages of code with if/then or switch:case buckets, I wanted to step back and see if there is a better way... I will have a table with up to 300 rules in it. Maybe more... In each Score table there is a column which will refer to a domain specific table and another table column that contains the property of that domain specific object. IceCream is a domain and scoops is a property I...
8
4870
by: Jerome Ranch | last post by:
Okay So I've got pivot tables setup in Access 2003. Only about 30K records in the current 2005 databases...the pivots summarize the info in a number of nice ways. I need to get the pivot tables into a document so I can distribute the tables, as is, as an electronic report (without the detailed data) So I export to rtf and xls, and I get an error that there is a too much information. I don't want all the data, just the summary table!
1
16387
by: lorirobn | last post by:
Hi, I have a report that works just fine. Now I would like to add the capability to choose selection criteria to limit what is displayed. I created several reports that do this, but they used VBA to create SQL statements, then apply them. Now that I have been using Access/VBA for awhile, I am wondering if there is a simpler way to do this than coding these long sql statements. My report has a query as its record source. Can I just...
3
4592
by: access baby | last post by:
when i creat query from Query Wizard and select the fields from table and click next it doesnt show me the option of Detail / Summary why is it so? i need to create query or say summarize data some thing like this Date status Total May 12 2006 Completed 15 May 13 2006 InProgress
5
2079
by: DeanL | last post by:
Hi all, I'm trying to set up a query that runs from a command button on a form (simple enough so far), what I want the query to do is take values from the fields on the form (seven fields in total) but sometimes not all the fields will be filled. If a field is empty then the assumption is that no filter will be applied to that field in the query and should return all results within the limits of the other field in the query.
1
2848
by: Barb.Richards | last post by:
I have created an append query that pulls information from one database, and will append the selected information into a new table. The fields are setup like 'number' 'category' 'code' 'shares' and 'dollars'. Using the "backend" of this table I can filter the numbers by right clicking and using Filter For: then enter 1 or 2 or 3 and this will return results for all information that has 1 or 2 or 3 as a number. However, the problem I...
5
3335
Jerry911
by: Jerry911 | last post by:
Hi, I have a query that I use to export data to a spreadsheet. The query itself works fine and I can manually edit the query to supply filtered information. What I would like to do is use a form that has several filter options so I do not have to modify my query every time I run it. I have a form with a list box to define one of the filters and I can make it work with that specific filter using the DoCmd.ApplyFilter function. I want/need to...
9
1845
by: sparks | last post by:
Right now I had to build a report that allowed the people to check for gross outliers in their data input. short I am looking at 2.5* std dev + - anyway I used 2 dummy variables in the query the report is tied to. start date and end date. This pops up an input box for these values and they put in 11/01/08 and 11/31/08 and it runs the report showing the outliers. I watched and everyone is looking at month not date Now I was thinking...
0
9431
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10014
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9689
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8688
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7226
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6514
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5289
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3326
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2647
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.