Skip to main content

Notifications

Microsoft Dynamics AX forum
Answered

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.

  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 227,979 Super User 2024 Season 2 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 227,979 Super User 2024 Season 2 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.

Helpful resources

Quick Links

Dynamics 365 Community Update

Welcome to the inaugural Community Platform Update. As part of our commitment to…

Dynamics 365 Community Newsletter - August 2024

Catch up on the latest D365 Community news

Community Spotlight of the Month

Kudos to Mohana Yadav!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,142 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 227,979 Super User 2024 Season 2

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans