$sth = $dbh->prepare('SELECT * FROM Table WHERE TimeCol >' . $dbh->quote($begin_time) . 'AND TimeCol <' . $dbh->quote($end_time))