C
chammock
I have a Group By query that groups records based on whether the Result
is Pass or Fail for a test. So for each item there could be 1 or 2 rows
in my query with more than one result for Pass or Fail. So I have a
Count on the Pass or Fail (ResultDescription) field.
My need is to assign a status based on how many Pass and Fail records I
have for each item. There can be up to 3 records for each item based on
the fact that 2 of 3 records must agree. If the first two tests are
Pass then the Status = Complete. If there is 1 Pass and 1 Fail, the
Status = Needs 3rd Test. If there are 2 Fail records, then Status =
Repair.
Hopefully you can see where I am going. I just cannot get my head
wrapped around the best way to aggregate the multiple records into a
Status. Here is a sample of the data.
ID Number ResultDescription CountOfResultID
137 Q1 Pass 1
137 Q1 Fail 2
In this case, item Q1 has two Fail and 1 Pass so the status = Needs
Repair.
is Pass or Fail for a test. So for each item there could be 1 or 2 rows
in my query with more than one result for Pass or Fail. So I have a
Count on the Pass or Fail (ResultDescription) field.
My need is to assign a status based on how many Pass and Fail records I
have for each item. There can be up to 3 records for each item based on
the fact that 2 of 3 records must agree. If the first two tests are
Pass then the Status = Complete. If there is 1 Pass and 1 Fail, the
Status = Needs 3rd Test. If there are 2 Fail records, then Status =
Repair.
Hopefully you can see where I am going. I just cannot get my head
wrapped around the best way to aggregate the multiple records into a
Status. Here is a sample of the data.
ID Number ResultDescription CountOfResultID
137 Q1 Pass 1
137 Q1 Fail 2
In this case, item Q1 has two Fail and 1 Pass so the status = Needs
Repair.