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
Solved

GP Batch Posting Error

Posted on 2011-09-09
2
772 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

Automatically creating a Trello card using data from a Microsoft Dynamics CRM record turned out to be an easy project that yielded great results.  Here's how I did this for an internal team at General Code.
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

789 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