General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Sandi,
I don't know about clever, but here's a fairly simple solution:
Perform your query, resulting in product code, descriptions and quantity into a cursor (for this example, named curQuery).
CREATE CURSOR curLabel (product_code C(10), product_desc C(50))
* Create a cursor for holding the final results
SELECT curQuery
SCAN
i = 0
FOR i = 1 TO curQuery.quantity
INSERT INTO curLabel (product_code, product_desc) ;
VALUES (curQuery.product_code, curQuery.product_desc)
ENDFOR
ENDSCAN
Now, you can use the curLabel cursor to create labels.
Doug
>Hi. I have a table that contains a product code, description and a quantity. I want to create an sql statement in order to product bar code labels. I cant figure out how to breakdown the quantity so I get a cursor with for each product the number of records relating to the quantity.ie.
>Part A is 3, Part B is 2 so I want:
> Part A
> Part A
> Part A
> Part B
> Part B
>
>Does anyone know a clever way to get this?
>
>TIA,
>
>Sandi
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only