Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT borrowers.cardnumber, borrowers.surname, borrowers.firstname, borrowers.address, borrowers.city, borrowers.zipcode, borrowers.email, borrowers.phone, borrowers.dateofbirth, borrowers.debarred, borrowers.categorycode, accountlines.date,
- FORMAT(SUM(accountlines.amountoutstanding),2) AS Due
- FROM borrowers, accountlines
- WHERE borrowers.categorycode IN ('CCPLSTAFF','IN','LIMITED','NONRES','RESIDENT','ROTARY') AND accountlines.date > DATE_SUB(CURDATE(),INTERVAL 60 DAY)
- AND borrowers.borrowernumber = accountlines.borrowernumber
- GROUP BY borrowers.borrowernumber
- HAVING SUM(accountlines.amountoutstanding) > 24.99
- ORDER BY borrowers.surname ASC;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement