Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Execute Query Adding two Ranges to same Queryrange

(0) ShareShare
ReportReport
Posted on by 6


qbr = this.query().dataSourceNo(1).addrange(fieldNum(SalesTable, SalesStatus));
qbr.value(queryValue((SalesStatus::Backorder)));

qbr = this.query().dataSourceNo(1).addrange(fieldNum(SalesTable, DeliveryDate));
qbr.value(DateFilter.valueStr());

super();

This code doesn't seem to filter open order for a specific date. Please help.

*This post is locked for comments

  • Martin Dráb Profile Picture
    233,710 Most Valuable Professional on at
    RE: Execute Query Adding two Ranges to same Queryrange

    I'm not sure what you want to see instead. What you're doing is indeed building a SQL query that will be sent to database, therefore the debugger offers you a way to review whether you've really built what you intended.

  • NoobDaxCoder Profile Picture
    6 on at
    RE: Execute Query Adding two Ranges to same Queryrange

    It is  a custom form. Datevalue() method solved the problem. I am learning Dynamics ax, in training.

    How to debug A query using debugger. For example, for a str, date variable i can see value being passed on to a variable. On other hand, for query, whatever is writern is transformed to select statement.. I am beginner Martin, any guidance will be greatly appreciated and I will be thankful for your help.

    querydebugger.png

  • Verified answer
    Martin Dráb Profile Picture
    233,710 Most Valuable Professional on at
    RE: Execute Query Adding two Ranges to same Queryrange

    In which form?

    Also you still didn't mention any debugging. First of all, open personalization of your form, switch to the Query tab and review whether your ranges are there.

    I think you'll see them, but with invalid value of the DeliveryDate range, because you're setting it wrong. Use qbr.value(queryValue(DateFilter.dateValue()) instead of qbr.value(DateFilter.valueStr()).

  • NoobDaxCoder Profile Picture
    6 on at
    RE: Execute Query Adding two Ranges to same Queryrange

    SalesTable_ds.ExecuteQuery. I wrote this code in SalesTable datasource execute query. SalesTable is in 1st position.

  • Martin Dráb Profile Picture
    233,710 Most Valuable Professional on at
    RE: Execute Query Adding two Ranges to same Queryrange

    Unfortunately we can't help you, because you didn't gave us any context. First of all, tell us where you're using your code, because it may be at a wrong place.

    Then tell us how you debugged it before giving it up and coming 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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Microsoft Dynamics AX (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 100 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 48

#3
Zain Mehmood Profile Picture

Zain Mehmood 6 Moderator

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans