$sql = "select distinct Volunteer from Volunteer where Volunteer =? and Date =?"; my $sth = $dbh->selectcol_arrayref( $sql, undef, $name, $date );