char *insert_delcand = 
    "INSERT INTO DelCandidates "
    "SELECT JobId, PurgedFiles, FileSetId FROM Job "
-   "WHERE JobTDate < %s " 
+   "WHERE JobType='%c' "
+   "AND JobTDate<%s " 
    "AND ClientId=%u";
 
 /* Select files from the DelCandidates table that have a
 char *select_backup_del =
    "SELECT DelCandidates.JobId "
    "FROM Job,DelCandidates "
-   "WHERE Job.JobTDate >= %s "
+   "WHERE Job.JobTDate>%s "
    "AND Job.ClientId=%u "
    "AND Job.JobType='B' "
    "AND Job.Level='F' "
 char *select_verify_del =
    "SELECT DelCandidates.JobId "
    "FROM Job,DelCandidates "
-   "WHERE Job.JobTDate >= %s "
+   "WHERE Job.JobTDate>%s "
    "AND Job.ClientId=%u "
    "AND Job.JobType='V' "
    "AND Job.Level='V' "
 char *select_restore_del =
    "SELECT DelCandidates.JobId "
    "FROM Job,DelCandidates "
-   "WHERE Job.JobTDate >= %s "
+   "WHERE Job.JobTDate>%s "
    "AND Job.ClientId=%u "   
    "AND Job.JobType='R'";
 
 
     *  and stuff them into the "DeletionCandidates" table.
     */
    edit_uint64(now - period, ed1);
-   Mmsg(&query, insert_delcand, ed1, cr.ClientId);
+   Mmsg(&query, insert_delcand, (char)JobType, ed1, cr.ClientId);
    if (!db_sql_query(ua->db, query, NULL, (void *)NULL)) {
       if (ua->verbose) {
          bsendmsg(ua, "%s", db_strerror(ua->db));
 
 /* */
 #define VERSION "1.28"
 #define VSTRING "1"
-#define DATE    "18 December 2002"
-#define LSMDATE "18Dec02"
+#define DATE    "19 December 2002"
+#define LSMDATE "19Dec02"
 
 /* Debug flags */
 #define DEBUG 1