EZi Posted November 24, 2022 Share Posted November 24, 2022 Hi, I'm trying to find out how much credit is allocated to any of our clients. Ie, a total amount of credit in WHMCS so we can put this amount on our balance sheet as a liability. I have been told that this is the query: SELECT * FROM tblclients WHERE tblclients.credit > 0 Not sure how to put this in the custom report? Any advice would be appreciated... Rene 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted November 24, 2022 Share Posted November 24, 2022 This. SELECT tblclients.id AS client_id, CONCAT(tblclients.firstname, " ", tblclients.lastname) AS client_name, tblclients.companyname AS client_company_name, SUM(tblcredit.amount) AS current_credit_balance FROM tblclients LEFT JOIN tblcredit ON tblclients.id = tblcredit.clientid GROUP BY tblclients.id 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.