Index: trunk/ippMonitor/def/detResidExp_failure.d
===================================================================
--- trunk/ippMonitor/def/detResidExp_failure.d	(revision 19726)
+++ trunk/ippMonitor/def/detResidExp_failure.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 Failures
 FILE  detResidExp_failure.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.exp_id = detInputExp.exp_id
 WHERE detResidExp.iteration = detInputExp.iteration
 WHERE detResidExp.fault > 0
+
+RESTRICT_COUNT AND rawExp.dateobs >= CURDATE()
+UNRESTRICTED AND rawExp.dateobs >= CURDATE()
 
 # define the arguments supplied to the links below (if any)
