?
Solved

GP Batch Posting Error

Posted on 2011-09-09
2
Medium Priority
?
783 Views
Last Modified: 2012-05-12
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


We have just started receiving this error in Great Plains 10 when a user attempts to Post a Sales Batch at the end of the day. The Post seems to still occur, but not before providing this error in a message box 4 or 5 times first. No change has been made to the query or process that posts here.
0
Comment
Question by:ryanwh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 25

Expert Comment

by:jogos
ID: 36543253
That's mostly something like

select street from adres
where employeeid = (select employeeid from employees where name = 'Jones')

and this runs fine when there is only 1 employee called Jones. The '=' expects only 1 value to be returned but with duplicates occur  

solutions
a) where employeeid IN (.....)
-> you get all the adresses from employees with the name Jones

b) = (select top 1 employeeid from employees ....)
selects only the first, in this case most likely 'forgetting' other employees

c) = (select employeeid from employees where name = 'jones' and firstname = 'Peter')
-> more specific so LESS likely there are duplicates  
0
 
LVL 25

Accepted Solution

by:
jogos earned 2000 total points
ID: 36543289
To complete, you mentioned the query was not changed. Exactly, it's the table content that triggers the error and only when multiple rows are found.  So in the above example it could be running for months without a problem and the moment the second Jones is hired the problem begins.
0

Featured Post

Does Your Cloud Backup Use Blockchain Technology?

Blockchain technology has already revolutionized finance thanks to Bitcoin. Now it's disrupting other areas, including the realm of data protection. Learn how blockchain is now being used to authenticate backup files and keep them safe from hackers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Desired Skill Set for Microsoft Dynamics CRM Technical Resources – Part II
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question