CREATE CURSOR dummy ( seqnum i) SELECT MAX(Qty) ; FROM mytable ; INTO ARRAY laMaxQty FOR i=1 TO laMaxQty INSERT INTO dummy VALUES (i) ENDFOR SELECT mytable.* ; FROM mytable ; JOIN dummy ON mytable.qty >= dummy.seqnum>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.