Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 491
  • Last Modified:

Access: Query: Consolidating rows of data

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
mtownsend1
Asked:
mtownsend1
  • 2
1 Solution
 
DockieBoyCommented:
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
 
Aaron TomoskyTechnology ConsultantCommented:
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
 
mtownsend1Author Commented:
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
 
Aaron TomoskyTechnology ConsultantCommented:
Or you can click the SQL button and just paste it in and change the table and column names
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now