From 9790d61cd1d36e2ec6291d4ffe05b33d643c4978 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Tue, 4 Aug 2020 07:34:21 +1000 Subject: [PATCH] Remove the having clause as well as having needs a group by --- CRM/Contact/BAO/Query.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php index a033530ba7..a6b2545d8b 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -4989,8 +4989,7 @@ civicrm_relationship.start_date > {$today} $sqlParts = $this->getSearchSQLParts(NULL, NULL, NULL, FALSE, FALSE, TRUE); $query = "SELECT DISTINCT LEFT(contact_a.sort_name, 1) as sort_name {$sqlParts['from']} - {$sqlParts['where']} - {$sqlParts['having']}"; + {$sqlParts['where']}"; $dao = CRM_Core_DAO::executeQuery($query); return $dao; } -- 2.25.1