Hi Jason
Thanks for the pointers - I've got it working using the following:
$paramSession_rsAccountants = "-1";
if (isset($_SESSION['JFBMicroID'])) {
$paramSession_rsAccountants = $_SESSION['JFBMicroID'];
}
and the recordset:
$query_rsAccountants = sprintf("SELECT *, COUNT(*)
FROM clients RIGHT OUTER JOIN accountants ON clients.AccountantID = accountants.AccountantID WHERE accountants.JFBMicroID = %s GROUP BY accountants.AccountantID, clients.AccountantID ORDER BY accountants.FirmName ASC",
It now displays the correct total number of clients for each accountant - except where there are no clients. If an accountant has no client, it's displaying 1 instead of 0. Any idea why this might be?