BOM baq

,

Query returned 0 rows

I don’t know what joins you have between the two part mtl tables.

are you sure they are correct?

Should all of the join types remain as matching?

Company to Company, MtlPartNum to MtlPartNum

company to company MtlPartNum to Partnum

Still getting 0 rows returned

If you only want rows that match the joins then yeah, otherwise you should do a left outer join.

okay, what is your join on part to part mtl?

Company to Company, PartNum to MtlPartNum

Partnum to PartNum Yash…

You should take a second and understand what the partmtl table is because it may help you in the future.

Ahh that one actually defaulted on its own

1 Like

Still getting 0 rows

okay, are you sure there is a part in order dtl with that SR material in its BOM?

Yes

Take off the SR filter on there.

Took it off, still getting 0 rows

Alright well the rest of your query criteria or joins are having an impact on it.

Everything before adding Part/PartMtl’s works perfectly fine so would that still be causing the new stuff to not work?

I’m not sure Yash. the query could be working as planned because those joins are fine. Here is a query I wrote and it returns rows where the material part num in the second level is 03-118.

SELECT *
FROM erp.OrderDtl od
join erp.PartMtl pm on od.Company = pm.Company and od.PartNum = pm.[PartNum]
join erp.PartMtl pm2 on pm.Company = pm2.Company and pm.MtlPartNum = pm2.PartNum
where od.OpenLine = 1 and pm2.MtlPartNum = ‘03-118’

In other words, maybe you don’t have any order details that have the SR part number in the second level of the part. Why don’t you look in the first level of the BOM.

So on your first part material table in the query make that Begins with criteria statement instead of doing it on the second one.

1 Like