Index: branches/pap/ippTools/share/difftool_pendingcleanuprun.sql
===================================================================
--- branches/pap/ippTools/share/difftool_pendingcleanuprun.sql	(revision 23948)
+++ branches/pap/ippTools/share/difftool_pendingcleanuprun.sql	(revision 25027)
@@ -9,5 +9,5 @@
     USING(diff_id)
 JOIN warpSkyfile
-    ON  diffInputSkyfile.warp_id    = warpSkyfile.warp_id
+    ON  diffInputSkyfile.warp1    = warpSkyfile.warp_id
     AND diffInputSkyfile.skycell_id = warpSkyfile.skycell_id
     AND diffInputSkyfile.tess_id    = warpSkyfile.tess_id
@@ -23,3 +23,3 @@
     USING(exp_id)
 WHERE
-    diffRun.state = 'goto_cleaned'
+    (diffRun.state = 'goto_cleaned' OR diffRun.state = 'goto_scrubbed' OR diffRun.state = 'goto_purged')
