Friday, November 29, 2013

Dynamics GP - Ar Reconcile Error

Problem:
While running an AR reconcile, this error was coming up

A get/change first operation on table 'RM_Distribution_History' (45)

[Microsoft][SQL Server Native Client 10.0][SQL Server]Incorrect syntax near 'S'.


[Microsoft][SQL Server Native Client 10.0][SQL Server]Unclosed quotation mark after the character string ') ORDER BY RMDTYPAL ASC ,DOCNUMBR ASC ,SEQNUMBR ASC '.

Cause:
This was due to a customer ID set as AL'S and the ' was causing the code to error out

Solution:
-- Script shows all records with an id containing the ' character
declare @ts as varchar (50)

set @ts = '%' + '''' + '%'
print @ts

select * from rm30301 where custnmbr like @ts


No comments:

Post a Comment