Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Access: Query: Consolidating rows of data

Posted on 2011-03-18
4
Medium Priority
?
485 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 750 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

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

722 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