Index: /trunk/ippTools/src/dettool.c
===================================================================
--- /trunk/ippTools/src/dettool.c	(revision 9928)
+++ /trunk/ippTools/src/dettool.c	(revision 9929)
@@ -921,9 +921,18 @@
 
     psString query = psStringCopy(
-            "SELECT detInputExp.det_id, detRun.det_type, rawImfile.*"
+            "SELECT"
+            "   detInputExp.det_id,"
+            "   detRun.det_type,"
+            "   rawImfile.*,"
+            "   rawDetrendExp.camera"
             " FROM rawImfile"
-            " JOIN detInputExp USING(exp_tag) "
-            " JOIN detRun ON detInputExp.det_id = detRun.det_id"
-            " WHERE detRun.state = 'run'"
+            " JOIN detInputExp"
+            "   USING(exp_tag) "
+            " JOIN rawDetrendExp"
+            "   USING(exp_tag) "
+            " JOIN detRun"
+            "   ON detInputExp.det_id = detRun.det_id"
+            " WHERE"
+            "   detRun.state = 'run'"
         );
 
