Hi
I need to look up 3 description values from the same table based on various versions of the same field.
I have set up the fields using SQL (I couldn't work out how to do it in Access) as ClassCode1, ClassCode2 and ClassCode3.
ClassCode3 is the number as it appears in the normal table so I can do that one.
ClassCode1 & 2 however are the first 3/6 digits of ClassCode3 with "0"'s at the end.
This is my SQL to get this far which works:
SELECT dbo_Products.PartNo, dbo_Products.ManuID, dbo_Product_Class.Description, Left(dbo_Products.ClassCode,3) & "000000" AS ClassCode1, Left(dbo_Products.ClassCode,6) & "000" AS ClassCode2, dbo_Products.ClassCode AS ClassCode3
FROM (New_SKU INNER JOIN dbo_Products ON New_SKU.Field1 = dbo_Products.PartNo) INNER JOIN dbo_Product_Class ON dbo_Products.ClassCode = dbo_Product_Class.ClassCode;
I need to look up both ClassCode1 & 2 against the same dbo_Products.ClassCode to get their descriptions (as with ClassCode3) but I can't work out how to do it.
I tried adding a second version of dbo_Product_Class but I couldn't work out how to join it to my concatenated fields.
Any help would really be appreciated.
Thanks
Shani