FROM branchtransfers
WHERE frombranch=?
AND tobranch=?
AND datesent IS NOT NULL
AND datearrived IS NULL
AND datecancelled IS NULL
";
my $sth = $dbh->prepare($query);
$sth->execute( $frombranch, $tobranch );
-