Index: trunk/ippTools/share/detselect_search.sql
===================================================================
--- trunk/ippTools/share/detselect_search.sql	(revision 16475)
+++ trunk/ippTools/share/detselect_search.sql	(revision 16511)
@@ -1,9 +1,15 @@
+-- this query needs to use the same fields in both of the tables in
+-- the union statement, but we need to report the
+-- detRunSummary.iteration in the first case, and this is missing in
+-- the second case.
+
 SELECT DISTINCT
     det_id,
-    iteration,
+    good_iteration as iteration,
     filelevel
 FROM
     (SELECT DISTINCT
-	detRun.*
+	detRun.*,
+	detRunSummary.iteration as good_iteration
     FROM detRun
     JOIN detRunSummary
@@ -14,5 +20,6 @@
     UNION
     SELECT DISTINCT
-        *
+	detRun.*,
+	detRun.iteration as good_iteration
     FROM detRun
     WHERE
