Index: trunk/ippMonitor/def/chipIQstats.d
===================================================================
--- trunk/ippMonitor/def/chipIQstats.d	(revision 36788)
+++ trunk/ippMonitor/def/chipIQstats.d	(revision 40882)
@@ -1,3 +1,3 @@
-TABLE chipRun, rawExp, chipProcessedImfile
+TABLE chipRun JOIN rawExp USING (exp_id) JOIN chipProcessedImfile using (chip_id)
 TITLE Per-Chip Image Quality Stats
 FILE  chipIQstats.php
@@ -6,9 +6,7 @@
 # limit this table to non-OBJECT types of images
 WHERE chipRun.state = 'full'
-WHERE chipRun.exp_id = rawExp.exp_id
-WHERE chipRun.chip_id = chipProcessedImfile.chip_id
 
-RESTRICT_COUNT AND dateobs >= CURDATE()
-UNRESTRICTED AND dateobs >= CURDATE()
+RESTRICT_COUNT AND rawExp.dateobs >= CURDATE()
+UNRESTRICTED AND rawExp.dateobs >= CURDATE()
 
 ARGS  ARG1  rawImfile.exp_id=$rawExp.exp_id
