I modified table name and columns, but this works great with a counter table.
Code:
INSERT INTO [Carton Numbers] ( InvNo, Sku, CartonNo )
SELECT Orders.InvNo, Orders.Sku, [CtNo]+1 AS CartonNo
FROM Orders, tblCountIndex
WHERE (((tblCountIndex.CtNo)<[Qty]))
ORDER BY Orders.InvNo, Orders.Sku, [CtNo]+1;
However, this code, I'm at a loss what to do with it.
Code:
SELECT CLng([singles].[num]+([tens].[num]*10)+([hundreds].[num]*100)+([thousands].[num]*1000)) AS [Counter]
FROM utilCounter AS singles, utilCounter AS tens, utilCounter AS hundreds, utilCounter AS thousands;
I changed it as well for table and column names, but it just runs forever and not into fruition. What am I missing?
Code:
SELECT CLng([singles].[CtNo]+([tens].[CtNo]*10)+([hundreds].[CtNo]*100)+([thousands].[CtNo]*1000)) AS [Counter]
FROM tblCountIndex AS singles, tblCountIndex AS tens, tblCountIndex AS hundreds, tblCountIndex AS thousands
ORDER BY CLng([singles].[CtNo]+([tens].[CtNo]*10)+([hundreds].[CtNo]*100)+([thousands].[CtNo]*1000));
Thank you!