Linq Queries

How to subtract two columns of same datatable and put the result in the same datatable to a new column?

1 Like

ForEach row In firstInputDT row(“Total”) = (CDbl(row(“Business Unit”).Tostring) - CDbl(row(“Quantity Ordered”).Tostring))
I used this query, it is not working for me…?

1 Like

@Manish540 In For each Row make sure both the columns have same Datatype , you cannot Subtract With Different Datatypes, Use Add Data Column Activity to add a new column then inside For each use a Add Data Row in a new table or Existing Table, if you are using New Table then Initialize

1 Like

Can you send me the sample query of it…