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

Notifications

Announcements

No record found.

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
    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
    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans