How to extract specific rows from datatable
Public dtMain as New DataTable("main") I have populated a datatable called dtMain, it looks something like this Line Date Type Details Amount 1 01/07/2005 SI P225LLK 425.11 For the entry T554KKL, it has been invoiced (line 2, the first SI), then credited (line 3, the SC) then reinvoiced (line 4, the second SI) What I want to do is loop through the table and extract any SI/SC pairs, so in this example lines 2+3, I then want to add these lines to the second table dtExtract The only way to link them together is the details will be the same, and the amount after removing any - signs Help appreciated, so far all I have is Dim drExAs DataRow Thanks
Public dtExtract as New DataTable("extract")
2 02/07/2005 SI T554KKL 85.25
3 02/07/2005 SC T554KKL -85.25
4 03/07/2005 SI T554KKL 108.25
5 04/07/2005 SI G401LLK 25.25
6 07/07/2005 SI K111OOP 115.60
ForEach drExIn dtMain.Rows
Next

