Solved

Access: Query: Consolidating rows of data

Posted on 2011-03-18
4
477 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
Comment Utility
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 38

Accepted Solution

by:
Aaron Tomosky earned 250 total points
Comment Utility
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
Comment Utility
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 38

Expert Comment

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

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

Suggested Solutions

It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

728 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now