Index: /tags/ipp-20101215/ippTools/src/pztool.c
===================================================================
--- /tags/ipp-20101215/ippTools/src/pztool.c	(revision 30539)
+++ /tags/ipp-20101215/ippTools/src/pztool.c	(revision 30540)
@@ -112,5 +112,5 @@
     PXOPT_LOOKUP_STR(telescope, config->args, "-telescope", true, false);
     PXOPT_LOOKUP_STR(uri, config->args, "-uri", true, false);
-    
+
     if (!pzDataStoreInsert(config->dbh,
             camera,
@@ -294,8 +294,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);
@@ -325,5 +327,5 @@
 
         if (psListLength(where->list)) {
-            psString whereClause = psDBGenerateWhereConditionSQL(where, "pzDownloadImfile");
+            psString whereClause = psDBGenerateWhereConditionSQL(where, NULL);
             psStringAppend(&query, " AND %s", whereClause);
             psFree(whereClause);
Index: /tags/ipp-20101215/ippTools/src/pztoolConfig.c
===================================================================
--- /tags/ipp-20101215/ippTools/src/pztoolConfig.c	(revision 30539)
+++ /tags/ipp-20101215/ippTools/src/pztoolConfig.c	(revision 30540)
@@ -77,4 +77,6 @@
     psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-telescope", 0,            "define telescope ID", NULL);
     psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-exp_type", 0,            "define exposure type", NULL);
+    psMetadataAddTime(pendingimfileArgs, PS_LIST_TAIL, "-dateobs_begin", 0,  "search for exposures by time (>=)", NULL);
+    psMetadataAddTime(pendingimfileArgs, PS_LIST_TAIL, "-dateobs_end", 0,  "search for exposures by time (<=)", NULL);
     psMetadataAddBool(pendingimfileArgs, PS_LIST_TAIL, "-desc", 0,            "sort ouput in descending format", false);
     psMetadataAddU64(pendingimfileArgs, PS_LIST_TAIL, "-limit",  0,            "limit result set to N items", 0);
