abc.XLSX (8.5 KB)
in the final output I want
this yellow part as a result.
Hey
give a try with
Left Assign drResult (Type DataRow)
dtInput.AsEnumerable().Where(Function(r) r(5).ToString().ToUpper().Equals("ACTIVE")).OrderByDescending(Function(x) CInt(x(0))).FirstOrDefault()
Regards
its works, but I want the result in data table form because I have to write the result in another write range.
Hey
just change it a little bit, kindly try this
LeftSide yourDTResult
dtInput.AsEnumerable().Where(Function(r) r(5).ToString().ToUpper().Equals("ACTIVE")).OrderByDescending(Function(x) CInt(x(0))).Take(1).CopyToDataTable
Regards!
dtInput=dtInput.AsEnumerable().Where(Function(r) r(5).ToString().ToUpper().Equals("ACTIVE")).OrderByDescending(Function(x) CInt(x(0))).FirstOrDefault().CopyToDataTable()
Regards,
Arivu
1 Like
ThankYou
Can you please tell me how to learn this type of code?
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.