Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need a clever Idea
Message
 
To
03/10/2002 11:31:47
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00707362
Message ID:
00707373
Views:
30
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
Map
View

Click here to load this message in the networking platform