Error: "Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression" - When using Contact (Primary) field in a constituent query

When using the Contact (Primary) fields in a constituent ad-hoc query, you might encounter the error "Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression."
This is caused by organization records having more than one primary contact on the relationship tab. Deleting the duplicate primary contact relationships will resolve this issue. To find organizations that have this problem, run the select statement below:
 

--Duplicate primary contacts

select RELATIONSHIPCONSTITUENTID, RECIPROCALCONSTITUENTID, ISPRIMARYCONTACT, count(*)

from dbo.RELATIONSHIP R

where ISPRIMARYCONTACT = 1

group by RELATIONSHIPCONSTITUENTID, RECIPROCALCONSTITUENTID, ISPRIMARYCONTACT

having count (*) > 1

Steps to Duplicate

1) Create a constituent ad-hoc query
2) Filter using any field with Contact (Primary) or display any Contact (Primary) fields in the results
3) After a few seconds, notice that the error is thrown.

Environment

 Blackbaud CRM
 4.0
 4.0.172.0

Was this article helpful?


Thanks for your feedback! Did this solve your issue?

Comments (optional):


Thanks for your feedback!
We're glad it was helpful but sorry it didn’t solve your issue. If you need assistance, click Chat with Support below.
We’re sorry to hear that. Please tell us why.

 I don't like how this works.

 The answer is confusing.

 The answer didn't match what I was searching for.

Additional Comments (optional):


Thanks for your feedback! If you need assistance, click Chat with Support below.
Thanks for your feedback. Help us make our products even better by sharing details in our Idea Banks or our online Community.
Thanks for letting us know. We'll work on clarifying the information in the article. If you need assistance, click Chat with Support below.
Thanks for letting us know. We'll work on updating the search engine to return more relevant results.