thanks sz
sorry for late reply,
yes it works..but i just realized about it that the ItemNum got child records for the Barcode things
so it required new table
it need to select the Barcode in ASC Order, the quantity for the barcode is always 1Code:Declare @Details Table (ItemNum varchar(10), Barcode varchar(10), Quantity int) Insert into @Details values ('AAA', 'A1', 1) Insert into @Details values ('AAA', 'A2', 1) Insert into @Details values ('AAA', 'A3', 1) Insert into @Details values ('BBB', 'B1', 1) Insert into @Details values ('CCC', 'C1', 1)
thanks




Reply With Quote