Solved

Access: Query: Consolidating rows of data

Posted on 2011-03-18
4
479 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
  • 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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

856 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