my $sh = $dbh->prepare("select * from records where date <= ? order by date asc, time asc limit ?,10000") || die "Could not prepare select: " . $dbh->errstr; my $date = "2005-02-26"; my $n = 0; $sh->bind_param(1, $date, SQL_DATE); $sh->bind_param(2, $n, SQL_INTEGER); $sh->execute() || die "Could not execute select: " . $dbh->errstr;