Writing 2 column data into 1 column

benkingery

Registered User.
Local time
Today, 00:10
Joined
Jul 15, 2008
Messages
153
I have a table that contains:

item | quantity
123 | 1
456 | 10
789 | 4

I need to get this data listed into a table that just has item and for it to look like this:

123
456
456
456
456
456
456
456
456
456
456
789
789
789
789

I understand and have accounted for the obvious primary key issue. I just can't figure out how to get the data to display out like this.

Any thoughts?

Thanks in advance.
 
Use VBA. This is probably the perfect starter project to learn it. Here's some psuedo code to base your actual code on:

Read In Table Data into RecordSet
For Each Record Do This:
--Get Quantity Value
--Write loop from 1 to Quantity Value and Do This:
----Write SQL INSERT Statment to put current records item value into new table
----Execute SQL statement created above
--End 1 to Quantity Value Loop
End Record Loop
Close RecordSet
 

Users who are viewing this thread

Back
Top Bottom