Skip to main content

Notifications

Microsoft Dynamics GP (Archived)

Business Portal "Incorrect syntax near ‘TO’"

Posted on by 6,775

When trying to convert a Requisition to a PO. Query Error. Microsoft.BusinessFramework.Data.GeneralDatabaseException Incorrect syntax near ‘TO’

Tried the KB article asking you to reset IIS, but no luck. 

*This post is locked for comments

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Business Portal "Incorrect syntax near ‘TO’"

    Yes, I have the same problem. I've run a SQL trace and I saw that is a missing comma in the order by (please see "_____")

    SELECT T0.[DocumentID],T0.[CompanyID],T0.[LineSequenceNumber],T0.[Item],T0.[ItemDescription],T0.[RequiredBy],T0.[UnitPrice],T0.[CompanyID],T0.[PricePrecision],T0.[CompanyID],T0.[Quantity],T0.[QuantityPrecision],T0.[UnitOfMeasure],T0.[ExtendedPrice],T0.[CompanyID],T0.[Site] FROM [DYNAMICS]..[ReqMgmtLines] T0 WITH (NOLOCK) 
    WHERE ((T0.[Vendor] = @p0) AND ((T0.[CompanyID] = @p1) AND ((T0.[PurchaseOrderDocument] = @p2) AND (T0.[LineStatus] = @p3)))) 
    ORDER BY T0.[Item] ASC,T0.[ItemDescription] ASC,T0.[UnitOfMeasure] ASC,T0.[Site] ASC,T0.[UnitPrice] _____ T0.[PricePrecision],T0.[RequiredBy] DESC,T0.[DocumentID] ASC,T0.[CompanyID] ASC,T0.[LineSequenceNumber] ASC 

    With the "iisreset" option doesn't work this time for me but restarting the BP site worked fine!

    Under the "Internet Information Services (IIS) Manager", select the "Business Portal" site, and on the rigth you'll find "Manage Web Site". Just press "restart" and have a nice day!

    Regards

    E.

  • Suggested answer
    RE: Business Portal "Incorrect syntax near ‘TO’"

    Hi John,

    Have you tried to open business portal on IE 8 or 9 and tried the above.

  • RE: Business Portal "Incorrect syntax near ‘TO’"

    If you want to troubleshoot yourself, you could look in the event viewer or do a sql trace.  They may offer some clues.  Otherwise, support is always happy to help.

    Thanks

    Rob

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Business Portal "Incorrect syntax near ‘TO’"

    I am unfortunately not able to take a screenshot at this time.  However, our issue is identical to the original posting.  Our users attempt to convert requisitions into purchase orders in Business Portal and receive the exact error message:

    Query Error. Microsoft.BusinessFramework.Data.GeneralDatabaseException Incorrect syntax near ‘TO’

    This began on the first day of our new fiscal year.  We performed an upgrade from GP 2010 to 2013 during the last fiscal year which included a SQL upgrade as well.  We did not have this issue in the last fiscal year after the upgrade.

  • Bill Campbell Profile Picture
    Bill Campbell 22,647 on at
    RE: Business Portal "Incorrect syntax near ‘TO’"

    John, since the original post was some time ago, could you post a screen shot of what your error message looks like.  It is often easier to see an error than to 'type an error'

    Thanks.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Business Portal "Incorrect syntax near ‘TO’"

    We are experiencing this issue as well.  Were you able to find a resolution?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Complete!

🔔 Be sure to subscribe to the new forums you are interested in to stay up to date! 🔔

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,113 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,918 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans