Issue: Docuphase Subquery returned more than 1 value

Date Documented:



Symptoms / Error

  • When searching for a document in the AP app we receive this error message.   Error Message: Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression. Error ID: c84b9e5f-998c-4177-b99a-340f06646275

Cause

  • This is caused by multiple current version documents. 

Fix

  • Run query to determine which documents has more than 1 current revision. 

  • Update data to change all not current revisions to a value of 0.

  • Query:  SELECT objectid, COUNT(*)

    FROM DocumentVersions

    WHERE applicationid = '2'

    AND istipversion = '1'

    GROUP BY objectid

    HAVING COUNT(*) > 1