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)

JoinMode in Query AX 2012 R3

(0) ShareShare
ReportReport
Posted on by

Hi experts,

when I create a query in SQL Server like below:

STEP1:

select EcoResCategoryHierarchy.name, * from Inventtransorigin
join Inventtrans
on Inventtransorigin.recid = Inventtrans.Inventtransorigin
join INVENTDIM
on INVENTDIM.INVENTDIMID = Inventtrans.INVENTDIMID

join InventTable
on InventTable.itemid = Inventtransorigin.itemid
JOIN EcoResProduct
ON InventTable.Product = EcoResProduct.RecId
left JOIN EcoResProductCategory
ON EcoResProduct.RecId = EcoResProductCategory.Product
left JOIN EcoResCategoryHierarchy
ON EcoResProductCategory.CategoryHierarchy = EcoResCategoryHierarchy.RecId
where Inventtrans.DATEFINANCIAL = '2017-04-11 00:00:00.000'

--> The results when I Excute this above query:

12_2D00_04_2D00_2017-14_2D00_03_2D00_23.jpg

STEP2:

And I create a query in AX AOT like pictures below:

12_2D00_04_2D00_2017-13_2D00_45_2D00_55.jpg12_2D00_04_2D00_2017-13_2D00_46_2D00_40.jpg

12_2D00_04_2D00_2017-13_2D00_47_2D00_26.jpg12_2D00_04_2D00_2017-13_2D00_48_2D00_01.jpg

--> when i use this Query:

12_2D00_04_2D00_2017-14_2D00_29_2D00_50.jpg

--> The result 

12_2D00_04_2D00_2017-14_2D00_05_2D00_57.jpg

-----------------------------------------------------------------------------------------------------------------------

Next, with the query in STEP1, I add one more range "and EcoResCategoryHierarchy.name = 'DANH MUC HANG MUA'"like:

STEP1-A

12_2D00_04_2D00_2017-14_2D00_10_2D00_17.jpg

And then, I add one more range for the query in STEP2:

STEP2-A

12_2D00_04_2D00_2017-14_2D00_14_2D00_16.jpg

and the result:

12_2D00_04_2D00_2017-14_2D00_14_2D00_26.jpg


The result in STEP1-A and STEP2-A is not same.

I think the query in STEP2-A not filter with range (Category hierarchies).Name

Anyone helps me, please?

NOTE: I'm customizing the Function: Closing and adjustment

The system's query is: InventTransAdjustment

And I want to add range range (Category hierarchies).Name to this query.

Thanks all!

*This post is locked for comments

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

    I suggest you stop merely speculating about what SQL code is sent from AX to database and you actually look at it (you can use extended events, for example, to catch the statement).

    I suspect you have to use a filter instead of a range.

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