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)

SQL Help Required - BOM Line detail

(0) ShareShare
ReportReport
Posted on by 50

Good morning,

I'm looking for some assistance with an SQL query. I'm attempting to show the BOM header, plus all of the individual line items within the BOM. I've *almost* got the result I'm looking for, however I can't seem to be able to show the individual item name, it is showing the BOM header name. I'm sure this is something very simple but I can't figure out if I'm missing a relation table in order to be able to show that information. My code so far is as follows;

 

SELECT ITEM.ITEMID,

Detail.NAME AS BOMHeader,

B.ITEMID AS ItemNo,

Detail.NAME AS ItemDescription

FROM BOMTABLE AS Detail

JOIN BOM AS B

ON B.BOMID = Detail.BOMID

JOIN InventTable AS Item

ON Detail.NAME = Item.NAMEALIAS

WHERE ITEM.ITEMID = 'xxx'

ORDER BY Item.ITEMID

Now I know that it is not best practice to join tables on a name field, however there is no other column that I can see that can be used to join, which is what is making me think I'm potentially missing a related table to give me the detail that I want. Any help will be massively appreciated.

Thanks

Rhiannon

*This post is locked for comments

I have the same question (0)
  • Ree-G Profile Picture
    50 on at

    Hi Crispin, thank you for taking the time to respond.

    The Item.ItemID is different to B.ItemID - Example,

    B.ItemID = Six digit numeric code

    Item.ItemID = Alphanumeric defined by the business, no digit limit

    The reason for ORDER BY Item.ITEMID is because I had an example whereby Item.ITEMID was ABC_123 and one that was ABC_123-1, ordering by kept them in order.

    Thanks

    Rhiannon

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 March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Andrew Jones a1x Profile Picture

Andrew Jones a1x 2

#3
GL-01081504-0 Profile Picture

GL-01081504-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans