Index: trunk/ippTools/src/pztool.c
===================================================================
--- trunk/ippTools/src/pztool.c	(revision 30206)
+++ trunk/ippTools/src/pztool.c	(revision 30227)
@@ -297,8 +297,10 @@
 
     psMetadata *where = psMetadataAlloc();
-    PXOPT_COPY_STR(config->args, where,  "-exp_name",     "exp_name", "==");
-    PXOPT_COPY_STR(config->args, where,  "-inst",         "camera", "==");
-    PXOPT_COPY_STR(config->args, where,  "-telescope",    "telescope", "==");
-    PXOPT_COPY_STR(config->args, where,  "-exp_type",     "exp_type", "==");
+    PXOPT_COPY_STR(config->args, where,  "-exp_name",      "exp_name",  "==");
+    PXOPT_COPY_STR(config->args, where,  "-inst",          "camera",    "==");
+    PXOPT_COPY_STR(config->args, where,  "-telescope",     "telescope", "==");
+    PXOPT_COPY_STR(config->args, where,  "-exp_type",      "exp_type",  "==");
+    PXOPT_COPY_TIME(config->args, where, "-dateobs_begin", "dateobs",   ">=");
+    PXOPT_COPY_TIME(config->args, where, "-dateobs_end",   "dateobs",   "<=");
 
     PXOPT_LOOKUP_BOOL(desc, config->args, "-desc", false);
@@ -328,5 +330,5 @@
 
         if (psListLength(where->list)) {
-            psString whereClause = psDBGenerateWhereConditionSQL(where, "pzDownloadImfile");
+            psString whereClause = psDBGenerateWhereConditionSQL(where, NULL);
             psStringAppend(&query, " AND %s", whereClause);
             psFree(whereClause);
