Index: trunk/ippTools/src/detselect.c
===================================================================
--- trunk/ippTools/src/detselect.c	(revision 12259)
+++ trunk/ippTools/src/detselect.c	(revision 14271)
@@ -192,5 +192,5 @@
     // single detrend image which matches all criteria and has the latest 
     // insertion date
-    psStringAppend(&query, " ORDER BY detRun.registered DESC LIMIT 1");
+    psStringAppend(&query, " ORDER BY registered DESC LIMIT 1");
 
     if (!p_psDBRunQuery(config->dbh, query)) {
