web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)
Answered

IN clause in Select Query X++

(0) ShareShare
ReportReport
Posted on by 5,248

I want to Use IN clause in SELECT Query. e.g.

SELECT USER_NAME FROM USERGROUPS WHERE  USER_NAME IN ('A','B','C')

Please share exact query if possible
Thanks

Bashir Ahmad

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    239,029 Most Valuable Professional on at

    This is a type of problem that you should resolve by opening the specification, not by asking in a forum.

    Refer to Select Statement Syntax next time. This time, I can tell you that IN() isn't supported by any version of Dynamics AX. Nevertheless you can add several ranges.

  • Verified answer
    Ivan (Vanya) Kashperuk Profile Picture
    Microsoft Employee on at

    So as Martin said, in() is not supported.

    So you are stuck with either concatenating the values and adding them as 1 range, or, if the number of such values can be large and exceed the range string limit, you can consider an exists join to the table containing these values (or a temp table you populate on the fly)

  • Andres Lemus Profile Picture
    75 on at

    I use a temporary table, and make a joins tables.

  • Community Member Profile Picture
    on at

    I know this is old post but I want to do exactly the same thing. Is possible to share the code?

  • Martin Dráb Profile Picture
    239,029 Most Valuable Professional on at

    Which code? There are several solutions mentioned above.

  • Martin Dráb Profile Picture
    239,029 Most Valuable Professional on at

    Update: I see that shinystar111 created a separate thread (How to do WHEREIN or contain in x++?), therefore let's not duplicate the discussion here.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 2

#2
Henrik Nordlöf Profile Picture

Henrik Nordlöf 2 User Group Leader

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans