SELECT DISTINCT
  CB.ClientID,
  CB.ClientBranchID,
  CB.BranchName,
  CB.MapReference,
  CB.NoOfEmployees,
  fnClientBranchRetainer(CB.ClientBranchID, NOW()) AS BranchRetainer
FROM
  taClientBranches AS CB
WHERE
  (CB.BranchStatus = 1) AND
  (TRIM(CB.MapReference) <> '')
ORDER BY
  6 DESC