How to compare input excel with yesterday output

Hi All,

I will get input file from datatbase i need to check input file file columns “Saled_order_id”, "Directory_number with previuos day report if sales order present in the previous day report i need to check "directory numbers coulmn if same directory numbers then i no need to add to queue if new directory numbers present for that sales order then only i have to add sales orders to queue. how to do this.
Process3Input.xlsx (122.8 KB) HVDSReport.xlsx (8.0 KB)

can same one help on this.

Regards,
Hima

Check this below code, @thima
Put this below query in If - condition,

NewRecordDt.AsEnumerable.Where(Function® Not( DatabaseDt.AsEnumerable.Any(Function(m) m(“Saled_order_id”).ToString.Trim.Equals(r(“Saled_order_id”).ToString.Trim) And m(“Directory_number”).ToString.Trim.Equals(r(“Directory_number”).ToString.Trim)))).Count > 0.

Then - You can add all the values to queue that will be in below code,

NewRecordDt.AsEnumerable.Where(Function® Not( DatabaseDt.AsEnumerable.Any(Function(m) m(“Saled_order_id”).ToString.Trim.Equals(r(“Saled_order_id”).ToString.Trim) And m(“Directory_number”).ToString.Trim.Equals(r(“Directory_number”).ToString.Trim)))).CopyToDataTable()

Else - Log as No new records.

Hope this may help you :slight_smile:

1 Like

I am getting below validation error in IF

@thima … you have added ® symbol…thats why the error…

It should be function ( r ) … remove the spaces here …

Thanks Prasanth

NewRecordDt.AsEnumerable.Where(Function® Not( DatabaseDt.AsEnumerable.Any(Function(m) m(“Saled_order_id”).ToString.Trim.Equals(r(“Saled_order_id”).ToString.Trim) And m(“Directory_number”).ToString.Trim.Equals(r(“Directory_number”).ToString.Trim)))).Count > 0

this query always giving me “False” even though records are present in both excels

Check whether you have any new records or not in excel manually? @thima

Yes i have Manish

How to delete matched rows in datatable

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.