Index: trunk/ippTools/share/dettool_toresidexp.sql
===================================================================
--- trunk/ippTools/share/dettool_toresidexp.sql	(revision 15527)
+++ trunk/ippTools/share/dettool_toresidexp.sql	(revision 15769)
@@ -56,5 +56,4 @@
     WHERE
         detRun.state = 'run'
-        AND (detResidImfile.fault = 0 || detResidImfile.fault IS NULL)
         AND detResidExp.det_id IS NULL
         AND detResidExp.iteration IS NULL
@@ -66,3 +65,4 @@
     HAVING
         COUNT(rawImfile.class_id) = COUNT(detResidImfile.class_id)
+        AND SUM(detResidImfile.fault = 0)
     ) AS toresidexp
