Overview
This article outlines how to create a custom report showing items/materials used in past work orders.
Solution
By default, the inventory history for an item only shows the work order# but not the actual part# for the item.
In order to see this information, it is necessary to create a custom report using the Advanced Query Builder as follows:
- Launch the Advanced Query Builder by navigating to Utility > Advanced Query Builder
- Supply a name for the new filter, e.g. Item Tracking Report.
- Paste the following query in the SQL Statement tab
SELECT
h.doc_no AS WO_Number,
h.ASSEMBLY_CODE, ih.descript AS Assembly_Name,
d.sequence, d.item_code,
id.descript AS Parts_Name,
d.item_std_qty, d.item_std_rate,
d.actual_qty, d.actual_rate
FROM
ASSEMBLY_WO_HEADER h
INNER JOIN Items ih WITH (NOLOCK) ON (h.ASSEMBLY_CODE = ih.itemno)
INNER JOIN ASSEMBLY_WO_DETAILS d WITH (NOLOCK) ON (h.ASSEMBLY_WO_HEADER_ID = d.ASSEMBLY_WO_HEADER_ID)
INNER JOIN Items id WITH (NOLOCK) ON (d.item_code = id.itemno)
WHERE
assembly_code LIKE :code
ORDER BY
h.doc_no,
d.SEQUENCE - Click on Update SQL then open the Browser Settings tab.
- Configure the Browser Settings tab as shown below:
- Click Find and enter the filtering criteria in the Value column when prompted to enter a value for the code parameter.
- It is recommended to uncheck Remember Parameter Values as it would retrieve the value from the default values set in the build which can in most cases be empty.
You can use % in the parameter to used as a wildcard. The example in the above screenshot will retrieve all items having ASSEMBLY_CODE values starting with 'PB'. - Click OK to generate the Item Tracking report.
Tip: The above SQL query can also be executed directly in SQL Server Management Studio for ad-hoc retrieval with a minor change to the WHERE clause to include the '<item code of the assembly>' i.e:
Replace
assembly_code LIKE :code
With
assembly_code LIKE 'PB%'
Comments
0 comments
Please sign in to leave a comment.