Index: trunk/ippTools/share/dettool_toresidexp.sql
===================================================================
--- trunk/ippTools/share/dettool_toresidexp.sql	(revision 19815)
+++ trunk/ippTools/share/dettool_toresidexp.sql	(revision 23229)
@@ -5,4 +5,6 @@
 -- id, detrend type, and whether the exposure was included in the stack for
 -- this iteration.
+
+-- require the corresponding detNormalizedExp to complete before starting
 
 -- select detRun.det_id
@@ -41,4 +43,6 @@
         detResidImfile.class_id
     FROM detRun
+    JOIN detNormalizedExp
+    	USING(det_id, iteration)
     JOIN detInputExp
         USING(det_id, iteration)
