I have a table PurchaseOrder that has ItemNo, QtyOrdered, PurchaseUOM and CostUOM. I have a another table called Conversions. I am trying to retrieve the appropriate conversion from the table.
For eg.
PurchaseOrder Table
ItemNo = Q1111
QtyOrdered = 60
PurchaseUOM = DRUM
CostUOM = GALLONS
Conversions Table
FromUOM = GALLONS
Operator = *
Factor = 30
ToUOM = DRUM
*** This means to get from GALLONS to DRUM multiply GALLONS by 30.
As you can see I only have it in the database from GALLONS to DRUM not the other way around. I need to create a query that shows me the conversion based on CostUOM matching either the FromUOM or ToUOM. Please note that one item could have multiple Conversions with different UOMs. So the Conversion Table UOM must match the CostUOM to be a valid conversion. Thank you.
For eg.
PurchaseOrder Table
ItemNo = Q1111
QtyOrdered = 60
PurchaseUOM = DRUM
CostUOM = GALLONS
Conversions Table
FromUOM = GALLONS
Operator = *
Factor = 30
ToUOM = DRUM
*** This means to get from GALLONS to DRUM multiply GALLONS by 30.
As you can see I only have it in the database from GALLONS to DRUM not the other way around. I need to create a query that shows me the conversion based on CostUOM matching either the FromUOM or ToUOM. Please note that one item could have multiple Conversions with different UOMs. So the Conversion Table UOM must match the CostUOM to be a valid conversion. Thank you.