There is an error in the HAVING clause.
For example, the clause might not contain a logical expression. For more information, see SELECT - SQL.