Solved

Access: Query: Consolidating rows of data

Posted on 2011-03-18
4
482 Views
Last Modified: 2012-05-11
In access, I'm importing data from a spreadsheet. Much of the data is the same from line to line. (This is testing data where most of the results say PASS). However, every once in a while something failed. So I'm likely to have something like

SN1:Test1: PASS
SN1:Test2: PASS
SN1:Test3: PASS
SN2:Test1: PASS
SN2:Test2: PASS
SN2:Test3: PASS
SN3:Test1: PASS
SN3:Test2: PASS
SN3:Test3: FAIL

Now I want to be able to say that SN (serial number) fails if there is a single failure but passes if all lines are PASS. I want to get query results that show:


SN1: PASS (ie all 3 tests pass)
SN2: PASS
SN3: FAIL

This is in Access 2002, and I'm fairly novice on this.
0
Comment
Question by:mtownsend1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 3

Expert Comment

by:DockieBoy
ID: 35169757
There should be a relatively easy solution for this, are you able to upload a copy of the db.

Probably just need to loop through records and use a select case, but will need some more infor to be sure :)
0
 
LVL 39

Accepted Solution

by:
Aaron Tomosky earned 250 total points
ID: 35169804
select sn, min(statuscolum) from table group by sn

Min works with letters also so if there is a fail anywhere for that sn it will show fail. If it's all pass it will show pass. You could laso change your structure so pass = 0 an fail = 1 then just sum the column. The number would be the number of fails.
0
 

Author Closing Comment

by:mtownsend1
ID: 35169836
This works well.  I had to figure out how to render this in the Access GUI, but it works by showing Totals and choosing the Group By of Min within the Design GUI.

Thanks!
0
 
LVL 39

Expert Comment

by:Aaron Tomosky
ID: 35170057
Or you can click the SQL button and just paste it in and change the table and column names
0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question