diff --git a/misc/maintenance/borrowers-force-messaging-defaults.pl b/misc/maintenance/borrowers-force-messaging-defaults.pl index e327834be9..d88d3870e2 100755 --- a/misc/maintenance/borrowers-force-messaging-defaults.pl +++ b/misc/maintenance/borrowers-force-messaging-defaults.pl @@ -57,7 +57,7 @@ WHERE bo.dateenrolled >= ?|; if( $no_overwrite ) { $sql .= " AND mp.borrowernumber IS NULL"; } - $sql .= " AND categorycode = ?" if $category; + $sql .= " AND bo.categorycode = ?" if $category; my $sth = $dbh->prepare($sql); $sth->execute($since, $category || () ); my $cnt = 0;