Based on your sample data ..this should work...There are also other (maybe better) ways to do it..by joining the table with itself...but you need to provide the table structure of these 2 tables.SELECT so_no, customer_po_no,line_no,facility,facility,shipped_date,facility,customer_part_no,item_no,item_description,facility,item_uom,weight_uom,package_qty_per,sum(qty) as qtyFROM SHP_CONTAINER_DETAIL,S_O_HEADERWHERE so_no = s_o_noAND customer_no = '1214'AND customer_po_no LIKE '1%'AND shipped = '1'AND shipped_date >= '12/16/2009 0:00:00 AM'AND shipped_date <= '12/16/2009 11:59:59 PM'group by so_no, customer_po_no,line_no,facility,facility,shipped_date,facility,customer_part_no,item_no,item_description,facility,item_uom,weight_uom,package_qty_per