Index: trunk/ippTools/src/dettool.c
===================================================================
--- trunk/ippTools/src/dettool.c	(revision 13937)
+++ trunk/ippTools/src/dettool.c	(revision 13974)
@@ -5001,4 +5001,5 @@
     PS_ASSERT_PTR_NON_NULL(config, false);
 
+    char *value = NULL;
     bool status = false;
     psU64 limit = psMetadataLookupU64(&status, config->args, "-limit");
@@ -5030,6 +5031,13 @@
         "   USING(exp_tag)"
         " WHERE"
-        "   detRun.state = 'run'"
     );
+    // NOTE the above WHERE is completed with the following line:
+
+    // add the two required restrictions: detRun.state and detRun.mode
+    if ((value = psMetadataLookupStr(&status, config->args, "-select_state"))) {
+        psStringAppend(&query, " detRun.state = '%s'", value);
+    } else {
+        psStringAppend(&query, " detRun.state = 'run'");
+    }
 
     if (config->where) {
