Join rules example 4 |
A report lists parts that have been issued to work orders that are currently open. This report obtains the list of parts from one table and the status of each work order from another table; the two tables must be joined on the work order ID.
Solution:
Select the Parts Issues table (PTD_MAIN) and the Job table (JOB_MAIN). The Parts Issues table contains information about all parts issued to work orders in FASuite; the Job table contains the current status of each work order.
Connections required:
FROM the Parts Issues table TO the Job table, through the Work order location ID, Work order year, and Work order number fields.
Required restriction:
JOB_MAIN.LOC_work_order_loc = PTD_MAIN.LOC_work_order_loc
AND JOB_MAIN.work_order_yr = PTD_MAIN.work_order_yr
AND JOB_MAIN.work_order_no = PTD_MAIN.work_order_no
Additional Restriction for Report:
This report needs an additional restriction to limit it to work orders that are currently open:
AND JOB_MAIN.work_order_status = 'OPEN'