IF SALES.CSTNO = PRICE.KEY1 THEN IF SALES.ITMID = PRICE.KEY 2 THEN PRICE.PRICE
ELSE IF SALES.ITMID = PRICE.KEY1 THEN IF SALES.CSTNO = PRICE.KEY2 THEN PRICE.PRICE
ELSE IF SALES.CSTTYP = PRICE.KEY THEN IF SALES.ITMID = PRICE.KEY2 THEN PRICE ELSE 0
So when I try to manage the joins it takes forever to run because PRICE.KEY1 and PRICE.KEY2 can be joined to three different fields in the SALES file.
What is the way to accomplish this?