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)

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

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