Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

X++ string functions

Posted on by 2,055

I need string functions which can used in X++. Specially I need sub string function, how we can get sub string using SQL query.

*This post is locked for comments

  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 230,198 Most Valuable Professional on at
    RE: X++ string functions

    X++ queries don't support such a kind of things. Consult the documentation (Select Statement Syntax [AX 2012]) if you don't know what's supported.

    To achieve what you need, create a view with a computed column, handle the logic in the application layer or, as the last resort, run a direct SQL query.

  • Nadeem Bhatti Profile Picture
    Nadeem Bhatti 2,055 on at
    RE: X++ string functions

    Sorry actually I need sql sub string function to use in X++. I have try the following code but its not working.

       select subStr(ChequeNum,1,3)  from bankChequeTable

           group by bankChequeTable.ChequeNum;

       info(bankChequeTable.ChequeNum);

  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 230,198 Most Valuable Professional on at
    RE: X++ string functions

    X++ function for substrings is called simply subStr().

    Nevertheless database servers don't understand X++, so you can't use X++ function in SQL commands.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans