Hello,
I have a query that compares part numbers from one table to another.
This gives me
ITNBR PARTNUM Material
0035-U DRILL
0036-03 0036-03 #2308-12 PLENCO
This works well, I am not sure if this can be done but what I would like is if the parts are equal grab the fields from "OPERATIONS" else if they do not match grab the fields from "OPERATIONSTYPE_Crosstab"
If the parts are equal
ITNBR PARTNUM Material INSERT DRILL DRILLQTY
0036-03 0036-03 #2308-12 PLENCO YES YES 1
If the parts are not equal
ITNBR PARTNUM Type1 Type2 Type3
0035-U DRILL CBORE
can this be done?
I have a query that compares part numbers from one table to another.
Code:
SELECT OPERATIONSTYPE_Crosstab.ITNBR, IIf(OPERATIONSTYPE_Crosstab.ITNBR=OPERATIONS.PARTNUM,OPERATIONS.MATERIAL,OPERATIONSTYPE_Crosstab.DRILL) AS Material
FROM OPERATIONSTYPE_Crosstab LEFT JOIN OPERATIONS ON OPERATIONSTYPE_Crosstab.ITNBR = OPERATIONS.PARTNUM
This gives me
ITNBR PARTNUM Material
0035-U DRILL
0036-03 0036-03 #2308-12 PLENCO
This works well, I am not sure if this can be done but what I would like is if the parts are equal grab the fields from "OPERATIONS" else if they do not match grab the fields from "OPERATIONSTYPE_Crosstab"
If the parts are equal
ITNBR PARTNUM Material INSERT DRILL DRILLQTY
0036-03 0036-03 #2308-12 PLENCO YES YES 1
If the parts are not equal
ITNBR PARTNUM Type1 Type2 Type3
0035-U DRILL CBORE
can this be done?