More articles like this can be found on our SQL Data Access menu.
This is a datasource for a report, against the Bill of Materials (BOM) tables.
Most of the data comes from BM30200 and BM30300.
We query the assembly items and add up the usage for the past 26 weeks, and then show average usage, quantity on hand, and lead time.
The purchasing department would use this report to order items.
The final query looks like this: