select
borrowers.cardnumber as cardnumber, concat(borrowers.title,' ',
borrowers.firstname,' ',borrowers.surname) as Name, borrowers.email as email,
sum(ROUND(accountlines.amountoutstanding,2)) as amountoutstanding from
borrowers
left
join accountlines on borrowers.borrowernumber =accountlines.borrowernumber
where
borrowers.categorycode=<<Enter category borrowers|categorycode>>
and accountlines.amountoutstanding >
0
and date(date)>=<<Enter From
Date|date>> and date(date)<=<<Enter To Date|date>>
group by borrowers.borrowernumber
No comments:
Post a Comment