my %where = (
status => ['Offered','Denied','Cancelled','Conditional Offer'],
sent_email => { '!=' => [ -and => undef, '0000-00-00' ] },
);
####
use strict; use warnings; use feature 'say';
use Data::Dumper;
use SQL::Abstract;
my %where = (
status => ['Offered','Denied','Cancelled','Conditional Offer'],
sent_email => { '!=' => [ -and => undef, '0000-00-00' ] },
);
my $sqla = SQL::Abstract->new;
my ( $sql, @bind ) = $sqla->select(
'TblRequests',
'sent_email',
\%where,
undef,
);
say $sql;
say Dumper \@bind;
__END__
####
SELECT sent_email FROM TblRequests WHERE ( ( ( sent_email IS NOT NULL AND sent_email != ? ) AND ( status = ? OR status = ? OR status = ? OR status = ? ) ) )
$VAR1 = [
'0000-00-00',
'Offered',
'Denied',
'Cancelled',
'Conditional Offer'
];