title: Subquery returned more than 1 value.4...Different query
body: <p>Hello I have this query that i am trying to execute and i keep getting this error "Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, &lt;, &lt;= , >, >= or when the subquery is used as an expression.", Kindly help please.</p>
  
  <pre><code>DECLARE @NUMCOUNT BIT
  
  Select @NUMCOUNT = (SELECT 
  CASE WHEN 
  
  
  (SELECT COUNT(R5REQUISLINES.RQL_REQ) 
  
         WHERE R5REQUISLINES.RQL_STATUS IN ('A')
         ) IN 
  (SELECT   COUNT(R5REQUISLINES.RQL_REQ)  
  
         WHERE R5REQUISLINES.RQL_STATUS IN ( 'A','C') ) THEN 1 else  0 END AS NUMCOUNT1
         FROM         R5REQUISLINES JOIN
                        R5REQUISITIONS ON R5REQUISLINES.RQL_REQ = R5REQUISITIONS.REQ_CODE
  
         GROUP BY R5REQUISLINES.RQL_REQ, R5REQUISITIONS.REQ_CODE,R5REQUISLINES.RQL_STATUS
  
   )
  
  IF @NUMCOUNT = '1'
  
  begin
  
  UPDATE R5REQUISITIONS
  
  SET R5REQUISITIONS.REQ_STATUS = 'CP'
  
  end
  </code></pre>