Index: trunk/ippMonitor/def/detResidExp.d
===================================================================
--- trunk/ippMonitor/def/detResidExp.d	(revision 24867)
+++ trunk/ippMonitor/def/detResidExp.d	(revision 40882)
@@ -1,3 +1,3 @@
-TABLE detResidExp, rawExp, detInputExp
+TABLE detResidExp JOIN rawExp USING (exp_id) JOIN detInputExp USING (det_id)
 TITLE detResidExp
 FILE  detResidExp.php
@@ -5,8 +5,9 @@
 
 # the following WHERE clauses are added to all queries joined by AND
-WHERE detResidExp.exp_id = rawExp.exp_id
-WHERE detResidExp.det_id = detInputExp.det_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
