Compare 2 data tables and select unique records in 2 data tables of all the columns in Data table 1 & 2

Hi All,

I have 2 Data tables like DT1 & DT2,

DT1 contains

Account Number Date
10001 12/12/2015
10002 12/12/2015

DT2
Account Number Amount
10001

@sivaramakrishna_raja It would be very Good if you were able to Show us an Output Datatable that you are Expecting as well :sweat_smile:

@sivaramakrishna_raja You wanted to get only unique records from both table ?

Use below linq query,
OutPutDT( Datatable type) = ( From d1 In DT1.AsEnumerable() Join d2 In DT2.AsEnumerable() On d1(“Account”).ToString Equals d2(“Account”).ToString Select d1 ).CopyToDataTable()
then write range OutPutDT.

1 Like

i am facing an issue while extracting unique records in 3 data tables

I have 3 Data tables like DT1 & DT2, DT3

DT1 contains

Account Number Date
10001 12/12/2015
10002 12/12/2015
10003 15/06/2017
10005 15/06/2017

DT2
Account Number Amount
10001 35
10002 70

DT3
Account Number Total Fee
10001 135
10003 79
The output should be as follow

output should as followos

Account Number Date Total Hold Total Fee
10001 12/12/2015 35 135
10002 12/12/2015 70
10003 15/06/2017 79
10005 15/06/2017

As per my understanding, You can use Join Datatable activity which will give you the expected result

1 Like

A post was merged into an existing topic: Compare 2 data tables and select unique records in 2 data tables of all the columns in Data table 1 and matched record amount value in Data table 2