I'm assuming you would like to get a result for the PTotal and one for the FTotal. So, take Expr1 and break it into to expressions like this:
Expr1: Sum(Abs(([1-Work Order /Kan Ban Card Present]="P")+([2-PIR at machine / Line]="P")+([3-PIR filled out per schedule]="P")+([4-SPC Chart data...
It depends on what "count" you're trying to get. Is it (for example):
1) the number of P's in all 11 fields of 1 record, or
2) the number of P's in 1 field of all the records, or
3) the number of P's in all 11 fields of all the records
Here's a solution for each:
1) SELECT Person...
Here's another possibility for you. It's very similar to Lothario's suggestion:
select t1.part_id, t1.part_name, t1.part_date
from yourtable t1
WHERE t1.part_date = ( Select max(t2.part_date)
from yourtable t2 Where t2.part_id = t1.part_id )
Hope this helps!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.