This error message appears when you try to use subquery (correlated or not) that returns more than one value to the calling query. This usually indicates that there are duplicate entries in the column of a table where it's expected to be unique. One of the reasons this may occur, is if the column in the affected table is not constrained to unique identifiers. Try each of the following steps until the issue is resolved.
  1. If using a SQL job then launch the SQL Server Profiler to trace the exact location of the issue.
  2. Insert a TOP 1 condition on your SELECT statement (ex: SELECT top 1 max(sequence) FROM TableName WHERE
  3. Check for duplicate numbers in the affected table (ex: SELECT * FROM table where id =(SELECT id FROM table1) --where table1 returns more than 1 value)
  4. Use the aggregate function MAX() which will guarantee that exactly only one value is returned and the subquery is syntactically valid. (ex: SELECT o.* FROM Northwind.dbo.Orders o
     WHERE o.OrderDate = (SELECT MAX(OrderDate) FROM Northwind.dbo.Orders)
  5. Use or extend your WHERE clause in the SQL subquery, to filter one or more fields for a unique value. 
Disclaimer: We provide programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes you are familiar with Structured Query Language and the tools used to create and modify SQL statements and Crystal Reports. Our Customer Support may help explain the functionality of a particular procedure, but we will not modify, or assist you with modifying, these examples to provide additional functionality.