Solved

GP Batch Posting Error

Posted on 2011-09-09
2
762 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
  • 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 500 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Having trouble getting your hands on Dynamics 365 Field Service or Project Service trial? Worry No More!!!
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

786 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