Index: trunk/ippTools/src/dettool.c
===================================================================
--- trunk/ippTools/src/dettool.c	(revision 9408)
+++ trunk/ippTools/src/dettool.c	(revision 9409)
@@ -1433,4 +1433,10 @@
         "   detRun.state = 'run'"
     );
+
+    // XXX need to add:
+    // JOIN detResidExp ON detResidExp.iteration = iteration - 1
+    // AND detResidExp.exp_tag = detProcessedImfile.exp_tag
+    // XXX and to WHERE:
+    // AND detResidExp.accept = 1
 
     if (config->where) {
