... my $sth=$dbh->prepare('SELECT * from '.$dbh->quote_identifier($table).' where month(Date)=?'); ...