+my $prospect_statement = "SELECT COUNT(*) FROM h_prospect_main
+ WHERE history_action = 'insert'
+ AND refnum = ?
+ AND history_date >= ?
+ AND history_date < ?
+ AND ". $curuser->agentnums_sql;
+my $prospect_sth = dbh->prepare($prospect_statement)
+ or die dbh->errstr;
+