What are your current tables with a few sample records. I would expect that
you have a table with each unique item.
An example:
Open the Northwind.mdb sample database and create a table with two fields
and these records:
tblOrderProducts
OrderNumber ProductIDs
A 1/2
B 5/6/7
C 1/6
D 9
Then create a query with the following sql:
SELECT tblOrderProducts.OrderNumber,
Products.ProductID
INTO tblOrderProductsNormalized
FROM Products, tblOrderProducts
WHERE ((("/" & [ProductIDs] & "/") Like "*/" & [ProductID] & "/*"))
ORDER BY tblOrderProducts.OrderNumber, Products.ProductID;
You will get a resulting table:
tblOrderProductsNormalized
OrderNumber ProductID
A 1
A 2
B 5
B 6
B 7
C 1
C 6
D 9
Duane Hookom
MS Access MVP
--
I renamed my table to match yours and used the exact code, but it did not
work for me (no records). I revised the first query to append to TblItems,
and then got results from the second query that are a little hopeful. One
record sort of worked, from Item1/Item2/Item3/Item4 to Item1/Item2. But I'm
out of ideas where to go from there.
I don't understand what you mean by "if you potentially have items like
Item1 and Item10 and Item10 where all characters of "Item1" are included
in "Item10" then you have to modify the query. That text field could have
ten items, each separated by the slash, or maybe only one. It varies with
every order number.
Cheryl
Duane Hookom wrote:
Your tblItems is not my sample tblItems. If you would have provided the
table names earlier, it might have avoided some confusion. I used
"tblOrderItems" as the original table name.