Index: trunk/ippMonitor/def/detResidExp_noimage.d
===================================================================
--- trunk/ippMonitor/def/detResidExp_noimage.d	(revision 19811)
+++ trunk/ippMonitor/def/detResidExp_noimage.d	(revision 40882)
@@ -1,3 +1,3 @@
-TABLE detResidExp, rawExp, detInputExp
+TABLE detResidExp JOIN rawExp USING (exp_id) JOIN detInputExp USING (exp_id)
 TITLE detResidExp
 FILE  detResidExp_noimage.php
@@ -5,7 +5,8 @@
 
 # the following WHERE clauses are added to all queries joined by AND
-WHERE detResidExp.exp_id = rawExp.exp_id
-WHERE detResidExp.exp_id = detInputExp.exp_id
 WHERE detResidExp.iteration = detInputExp.iteration
+
+RESTRICT_COUNT AND rawExp.dateobs >= CURDATE()
+UNRESTRICTED AND rawExp.dateobs >= CURDATE()
 
 # define image names to be used below
