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)

How to use 'IN' sql statement in my query?

(0) ShareShare
ReportReport
Posted on by 45

I'm using select statement in fetch method rather than QBR.  But I need to filter multi workcentre (machine01, machine03, machine 010) in my statement which is free input text by user.  Usually IN might work, but in AX, how to use IN statement?

 

Thanks in advance.

*This post is locked for comments

I have the same question (0)
  • Darren Yu Profile Picture
    Microsoft Employee on at

    keyword in is not supported in X++ select statement. I guess you have to OR, i.e.

    select * from table1

       where field1 == table1.machine01 ||

           table1.field1 == machine02 ||

           table1.field1 == machine03;

  • Mazlina Aziz Profile Picture
    45 on at

    Thank for your reply.

    In that case, how do I handle dynamic inputs, say machine could be define as 1 machine or maybe user decide to filter 5 machines at 1 time?  How 'where' can handle this dynamic input?

  • Verified answer
    Darren Yu Profile Picture
    Microsoft Employee on at

    You couldn't do dynamics range with select statement. have to use query ..with dynamic ranges.. sorry about that, however, query should make sense for this scenario.

  • Mazlina Aziz Profile Picture
    45 on at

    In that case, thanks.  Will try on query part.

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 39

#2
Michel ROY Profile Picture

Michel ROY 14

#3
imran ul haq Profile Picture

imran ul haq 8

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans