Hi all. I hope that I can explain this problem clearly so that I may be understood, so please bear with me.
I am trying to build a query that will match data from one table to data of another table with an extension added to the number. At my company we must generate a report each week for one of our work sites that shows part numbers that show inventory levels lower than the minimum, letting the purchasing people know that part number needs ordered. Our problem occurs because out of the 32,000 part numbers on file at this site, we have up to THREE part numbers that are for the same part.
Each number is an identical 7-digits for each part, with an added extention showing that part's origin. An example would be: 7449836 (base part number) 7449836-C (company owned part number) 7449836-ISA (third party part number). As we are trying to liquidate the stock from the -C and -ISA parts numbers, we need to know if when the stock gets low on the base number parts, there is a corresponding part number in the other two categories that has sufficient stock to sell.
I have started this query process by creating two make table queries. The first one is a simple conversion of the purchase report query we use to show low stock numbers into a make table. I have added a field in the original query that generates the part number's first seven digits.
(NEW PROD #: Left([PRODUCT #],7))
I did the same thing for our inventory file, so that I would have a matching number to join each table to.
I have tried left statements such as LIKE LEFT([PRODUCT #],7)AND "-C" as well as IIF statements with the same criteria, with no positive results.
I need some suggestions as to a new approach to the logic, because I am running out of ideas fast!
Any and all help is greatly appreciated!
Thanks!
I am trying to build a query that will match data from one table to data of another table with an extension added to the number. At my company we must generate a report each week for one of our work sites that shows part numbers that show inventory levels lower than the minimum, letting the purchasing people know that part number needs ordered. Our problem occurs because out of the 32,000 part numbers on file at this site, we have up to THREE part numbers that are for the same part.
Each number is an identical 7-digits for each part, with an added extention showing that part's origin. An example would be: 7449836 (base part number) 7449836-C (company owned part number) 7449836-ISA (third party part number). As we are trying to liquidate the stock from the -C and -ISA parts numbers, we need to know if when the stock gets low on the base number parts, there is a corresponding part number in the other two categories that has sufficient stock to sell.
I have started this query process by creating two make table queries. The first one is a simple conversion of the purchase report query we use to show low stock numbers into a make table. I have added a field in the original query that generates the part number's first seven digits.
(NEW PROD #: Left([PRODUCT #],7))
I did the same thing for our inventory file, so that I would have a matching number to join each table to.
I have tried left statements such as LIKE LEFT([PRODUCT #],7)AND "-C" as well as IIF statements with the same criteria, with no positive results.
I need some suggestions as to a new approach to the logic, because I am running out of ideas fast!
Any and all help is greatly appreciated!
Thanks!